@salilvnair/dui 1.0.7 → 1.0.8

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.
Files changed (152) hide show
  1. package/dist/assets/DuiShowcase-C18KoqHP.css +1 -0
  2. package/dist/assets/{DuiShowcase-CSkP-vdJ.js → DuiShowcase-DwihGCxO.js} +1377 -1359
  3. package/dist/assets/{index-DQdlwLhi.js → index-D9rPjVPP.js} +2 -2
  4. package/dist/chunks/{daakia-icons-BpwUOdSO.js → daakia-icons-DYLRx0Yi.js} +1096 -1053
  5. package/dist/chunks/daakia-icons-DYLRx0Yi.js.map +1 -0
  6. package/dist/chunks/doc-path-D2_JUEIe.js +695 -0
  7. package/dist/chunks/doc-path-D2_JUEIe.js.map +1 -0
  8. package/dist/icons/daakia-icons.d.ts +24 -0
  9. package/dist/index.html +1 -1
  10. package/dist/index.js +20939 -17293
  11. package/dist/index.js.map +1 -1
  12. package/dist/lib/components/button/AIButtonView.d.ts +10 -1
  13. package/dist/lib/components/button/ActionButtonView.d.ts +42 -0
  14. package/dist/lib/components/button/BookmarkButtonView.d.ts +10 -1
  15. package/dist/lib/components/button/FabView.d.ts +10 -1
  16. package/dist/lib/components/button/FollowButtonView.d.ts +10 -1
  17. package/dist/lib/components/button/HoldToConfirmView.d.ts +10 -1
  18. package/dist/lib/components/button/LikeButtonView.d.ts +10 -1
  19. package/dist/lib/components/button/MorphingIconButtonView.d.ts +10 -1
  20. package/dist/lib/components/button/SegmentedView.d.ts +10 -1
  21. package/dist/lib/components/button/ThemeToggleView.d.ts +10 -1
  22. package/dist/lib/components/button/VoteWidgetView.d.ts +10 -1
  23. package/dist/lib/components/chips/ChipView.d.ts +32 -1
  24. package/dist/lib/components/chips/CommandChipView.d.ts +10 -1
  25. package/dist/lib/components/display/BadgeChipView.d.ts +25 -0
  26. package/dist/lib/components/display/DonutView.d.ts +35 -0
  27. package/dist/lib/components/display/EmptyStateView.d.ts +33 -1
  28. package/dist/lib/components/display/FileBrowserView.d.ts +143 -0
  29. package/dist/lib/components/display/FileBrowserView.test.d.ts +1 -0
  30. package/dist/lib/components/display/FindingCardView.d.ts +36 -0
  31. package/dist/lib/components/display/FlameGraphView.d.ts +32 -0
  32. package/dist/lib/components/display/GroupHeaderView.d.ts +28 -0
  33. package/dist/lib/components/display/IssueCardSkeletonView.d.ts +28 -0
  34. package/dist/lib/components/display/IssueCardView.d.ts +40 -0
  35. package/dist/lib/components/display/LaneChartView.d.ts +46 -0
  36. package/dist/lib/components/display/LineDiffView.d.ts +25 -0
  37. package/dist/lib/components/display/PriorityMarkView.d.ts +20 -0
  38. package/dist/lib/components/display/SetupOptionView.d.ts +56 -0
  39. package/dist/lib/components/display/SunburstView.d.ts +32 -0
  40. package/dist/lib/components/display/SwimlaneChartView.d.ts +48 -0
  41. package/dist/lib/components/display/TableSkeletonView.d.ts +34 -0
  42. package/dist/lib/components/display/hierarchy-layout.d.ts +114 -0
  43. package/dist/lib/components/display/hierarchy-layout.test.d.ts +1 -0
  44. package/dist/lib/components/display/lane-scale.d.ts +67 -0
  45. package/dist/lib/components/display/lane-scale.test.d.ts +1 -0
  46. package/dist/lib/components/display/line-diff.d.ts +42 -0
  47. package/dist/lib/components/input/AvatarUploadView.d.ts +10 -1
  48. package/dist/lib/components/input/CalendarView.d.ts +10 -1
  49. package/dist/lib/components/input/CascaderView.d.ts +10 -1
  50. package/dist/lib/components/input/ChatInputView.d.ts +10 -1
  51. package/dist/lib/components/input/CheckboxView.d.ts +10 -1
  52. package/dist/lib/components/input/ChecklistView.d.ts +10 -1
  53. package/dist/lib/components/input/ColorPickerView.d.ts +10 -1
  54. package/dist/lib/components/input/ComboBoxView.d.ts +10 -1
  55. package/dist/lib/components/input/DateInputView.d.ts +10 -1
  56. package/dist/lib/components/input/DateRangePickerView.d.ts +10 -1
  57. package/dist/lib/components/input/DateTimeInputView.d.ts +10 -1
  58. package/dist/lib/components/input/DialKnobInputView.d.ts +10 -1
  59. package/dist/lib/components/input/DurationInputView.d.ts +10 -1
  60. package/dist/lib/components/input/EditorView.d.ts +8 -0
  61. package/dist/lib/components/input/EditorView.shell.d.ts +9 -1
  62. package/dist/lib/components/input/EmojiPickerView.d.ts +10 -1
  63. package/dist/lib/components/input/FeedbackWidgetView.d.ts +10 -1
  64. package/dist/lib/components/input/FileDropzoneView.d.ts +10 -1
  65. package/dist/lib/components/input/FilterInputView.d.ts +25 -0
  66. package/dist/lib/components/input/FloatingLabelInputView.d.ts +10 -1
  67. package/dist/lib/components/input/FormDataTableView.d.ts +10 -1
  68. package/dist/lib/components/input/GhostTypingPlaceholderView.d.ts +10 -1
  69. package/dist/lib/components/input/HiddenKeyValueItemView.d.ts +10 -1
  70. package/dist/lib/components/input/HighlightedInputView.d.ts +12 -1
  71. package/dist/lib/components/input/IconPickerView.d.ts +10 -1
  72. package/dist/lib/components/input/InlineEditTextView.d.ts +10 -1
  73. package/dist/lib/components/input/InviteInputView.d.ts +10 -1
  74. package/dist/lib/components/input/KeyValueTableRowView.d.ts +10 -1
  75. package/dist/lib/components/input/KeyValueTableView.d.ts +10 -1
  76. package/dist/lib/components/input/MarkdownEditorView.d.ts +30 -0
  77. package/dist/lib/components/input/MaskedInputView.d.ts +10 -1
  78. package/dist/lib/components/input/MentionInputView.d.ts +10 -1
  79. package/dist/lib/components/input/MergedInputView.d.ts +10 -1
  80. package/dist/lib/components/input/NpsSurveyView.d.ts +10 -1
  81. package/dist/lib/components/input/OtpInputView.d.ts +10 -1
  82. package/dist/lib/components/input/PhoneInputView.d.ts +10 -1
  83. package/dist/lib/components/input/PickerView.d.ts +10 -1
  84. package/dist/lib/components/input/PriorityPickerView.d.ts +10 -1
  85. package/dist/lib/components/input/RadioCardView.d.ts +10 -1
  86. package/dist/lib/components/input/RadioGroupView.d.ts +10 -1
  87. package/dist/lib/components/input/RangeSliderView.d.ts +10 -1
  88. package/dist/lib/components/input/RatingView.d.ts +10 -1
  89. package/dist/lib/components/input/RichTextToolbarView.d.ts +10 -1
  90. package/dist/lib/components/input/RoleSelectView.d.ts +10 -1
  91. package/dist/lib/components/input/SearchFieldView.d.ts +33 -0
  92. package/dist/lib/components/input/SegmentedControlView.d.ts +20 -1
  93. package/dist/lib/components/input/SelectInputView.d.ts +32 -1
  94. package/dist/lib/components/input/SelectTextInputView.d.ts +12 -1
  95. package/dist/lib/components/input/ShortcutRecorderView.d.ts +10 -1
  96. package/dist/lib/components/input/SliderView.d.ts +10 -1
  97. package/dist/lib/components/input/SpectrumSliderView.d.ts +10 -1
  98. package/dist/lib/components/input/StepperInputView.d.ts +10 -1
  99. package/dist/lib/components/input/SwatchPickerView.d.ts +38 -0
  100. package/dist/lib/components/input/SwitchGroupView.d.ts +10 -1
  101. package/dist/lib/components/input/TabView.d.ts +10 -1
  102. package/dist/lib/components/input/TagInputView.d.ts +10 -1
  103. package/dist/lib/components/input/TextInputView.d.ts +9 -0
  104. package/dist/lib/components/input/ThemeCardSelectorView.d.ts +10 -1
  105. package/dist/lib/components/input/TimeWheelView.d.ts +10 -1
  106. package/dist/lib/components/input/TimeZoneSelectView.d.ts +40 -0
  107. package/dist/lib/components/input/TimeZoneSelectView.test.d.ts +1 -0
  108. package/dist/lib/components/input/TogglePillView.d.ts +51 -0
  109. package/dist/lib/components/input/ToggleSwitchView.d.ts +10 -1
  110. package/dist/lib/components/input/TransferListView.d.ts +10 -1
  111. package/dist/lib/components/input/TreeSelectView.d.ts +10 -1
  112. package/dist/lib/components/input/WizardStepperView.d.ts +10 -1
  113. package/dist/lib/components/input/doc-path.d.ts +52 -0
  114. package/dist/lib/components/input/doc-path.test.d.ts +1 -0
  115. package/dist/lib/components/input/markdown-serialise.d.ts +23 -0
  116. package/dist/lib/components/input/select-position.test.d.ts +1 -0
  117. package/dist/lib/components/layout/PathBreadcrumbView.d.ts +67 -0
  118. package/dist/lib/components/layout/PathBreadcrumbView.test.d.ts +1 -0
  119. package/dist/lib/components/layout/SplitPanelView.d.ts +26 -1
  120. package/dist/lib/components/modal/ActionSheetView.d.ts +10 -1
  121. package/dist/lib/components/modal/AlertDialogView.d.ts +10 -1
  122. package/dist/lib/components/modal/BottomSheetView.d.ts +10 -1
  123. package/dist/lib/components/modal/CommandPaletteView.d.ts +10 -1
  124. package/dist/lib/components/modal/ContextMenuView.d.ts +19 -1
  125. package/dist/lib/components/modal/DrawerView.d.ts +10 -1
  126. package/dist/lib/components/modal/InfoPopupView.d.ts +13 -1
  127. package/dist/lib/components/modal/ModalView.d.ts +19 -3
  128. package/dist/lib/components/modal/NotificationCenterView.d.ts +10 -1
  129. package/dist/lib/components/modal/PopoverView.d.ts +10 -1
  130. package/dist/lib/components/modal/SheetView.d.ts +31 -0
  131. package/dist/lib/components/modal/SpotlightTourView.d.ts +10 -1
  132. package/dist/lib/components/modal/StackedToastDeckView.d.ts +10 -1
  133. package/dist/lib/components/modal/sheet-drag.d.ts +60 -0
  134. package/dist/lib/components/modal/sheet-drag.test.d.ts +1 -0
  135. package/dist/lib/components/tabs/PilledTabView.d.ts +10 -1
  136. package/dist/lib/components/tabs/TabBarView.d.ts +10 -1
  137. package/dist/lib/components/tabs/UnderlineTabsView.d.ts +41 -0
  138. package/dist/lib/components/testid.test.d.ts +1 -0
  139. package/dist/lib/core/IconSize.d.ts +37 -0
  140. package/dist/lib/core/TerminalPalette.d.ts +81 -0
  141. package/dist/lib/core/TerminalPaletteFile.d.ts +61 -0
  142. package/dist/lib/core/TerminalPaletteFile.test.d.ts +1 -0
  143. package/dist/lib/index.d.ts +65 -0
  144. package/dist/monaco-setup.js +589 -493
  145. package/dist/monaco-setup.js.map +1 -1
  146. package/dist/style.css +1 -1
  147. package/dist/theme/editor.js +1 -1
  148. package/package.json +5 -3
  149. package/dist/assets/DuiShowcase-CRLG9S4N.css +0 -1
  150. package/dist/chunks/EditorView.shell-DWGMOgiy.js +0 -510
  151. package/dist/chunks/EditorView.shell-DWGMOgiy.js.map +0 -1
  152. package/dist/chunks/daakia-icons-BpwUOdSO.js.map +0 -1
@@ -1,146 +1,146 @@
1
- import Z, { DiffEditor as ge, loader as ce } from "@monaco-editor/react";
1
+ import Y, { DiffEditor as fe, loader as pe } from "@monaco-editor/react";
2
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
- function z() {
12
- var t;
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";
3
+ import { q as X, E as Q, A as me, G as he, H as ke, I as be, J as Ce } from "./chunks/doc-path-D2_JUEIe.js";
4
+ import { jsx as M } from "react/jsx-runtime";
5
+ import { useState as ye, useEffect as A, useRef as R, useCallback as z, useMemo as ee } from "react";
6
+ import ve from "monaco-editor/esm/vs/editor/editor.worker?worker&inline";
7
+ import we from "monaco-editor/esm/vs/language/json/json.worker?worker&inline";
8
+ import Ee from "monaco-editor/esm/vs/language/html/html.worker?worker&inline";
9
+ import Te from "monaco-editor/esm/vs/language/typescript/ts.worker?worker&inline";
10
+ import { javascriptDefaults as P, JsxEmit as te, ModuleResolutionKind as ne, ModuleKind as oe, ScriptTarget as re, typescriptDefaults as ie } from "monaco-editor/esm/vs/language/typescript/monaco.contribution";
11
+ function H() {
12
+ var n;
13
+ const e = ((n = document.body) == null ? void 0 : n.getAttribute("data-vscode-theme-kind")) || document.documentElement.getAttribute("data-vscode-theme-kind");
14
+ return e ? e === "vscode-light" ? "light" : "dark" : document.documentElement.getAttribute("data-theme") || "dark";
15
15
  }
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();
16
+ function j() {
17
+ const [e, n] = ye(H);
18
+ return A(() => {
19
+ const r = () => n(H()), i = new MutationObserver(r);
20
+ i.observe(document.documentElement, { attributes: !0, attributeFilter: ["data-theme", "data-vscode-theme-kind"] });
21
+ const l = new MutationObserver(r);
22
+ return document.body && l.observe(document.body, { attributes: !0, attributeFilter: ["data-vscode-theme-kind"] }), () => {
23
+ i.disconnect(), l.disconnect();
24
24
  };
25
- }, []), n;
25
+ }, []), e;
26
26
  }
27
- const Ee = "";
28
- function we(n, t, r) {
27
+ const xe = "";
28
+ function Se(e, n, r) {
29
29
  return [];
30
30
  }
31
- function Te(n) {
31
+ function Ne(e) {
32
32
  const {
33
- breakpoints: t,
33
+ breakpoints: n,
34
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();
35
+ conditionalBreakpointLines: i,
36
+ pausedLine: l,
37
+ onToggleBreakpoint: u,
38
+ onGlyphContextMenu: d
39
+ } = e, t = R(null), g = R(null), C = R([]), m = R([]), f = R([]), b = R([]), w = z((o) => {
40
+ const c = t.current;
41
+ if (!c) return !0;
42
+ const h = c.getModel();
43
+ return !h || o > h.getLineCount() ? !1 : !!h.getLineContent(o).trim();
44
44
  }, []);
45
- return L(() => {
46
- const i = e.current, s = k.current;
47
- if (!i || !s) return;
48
- const d = [];
49
- if (t)
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),
45
+ return A(() => {
46
+ const o = t.current, c = g.current;
47
+ if (!o || !c) return;
48
+ const h = [];
49
+ if (n)
50
+ for (const s of n) {
51
+ if (l && s === l) continue;
52
+ const p = r == null ? void 0 : r.includes(s), y = i == null ? void 0 : i.includes(s);
53
+ let k = "daakia-bp-glyph";
54
+ p ? k = "daakia-bp-glyph--disabled" : y && (k = "daakia-bp-glyph--conditional"), h.push({
55
+ range: new c.Range(s, 1, s, 1),
56
56
  options: {
57
57
  isWholeLine: !0,
58
- className: C ? "" : "daakia-bp-line",
59
- stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
60
- glyphMarginClassName: p,
58
+ className: p ? "" : "daakia-bp-line",
59
+ stickiness: c.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
60
+ glyphMarginClassName: k,
61
61
  glyphMarginHoverMessage: {
62
- value: E ? "Conditional Breakpoint" : C ? "Disabled Breakpoint" : "Breakpoint"
62
+ value: y ? "Conditional Breakpoint" : p ? "Disabled Breakpoint" : "Breakpoint"
63
63
  }
64
64
  }
65
65
  });
66
66
  }
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),
67
+ C.current = o.deltaDecorations(C.current, h);
68
+ }, [n, r, i, l]), A(() => {
69
+ const o = t.current, c = g.current;
70
+ if (!(!o || !c))
71
+ if (l) {
72
+ const s = (n == null ? void 0 : n.includes(l)) ? "daakia-paused-line__arrow daakia-paused-line__arrow--with-bp" : "daakia-paused-line__arrow";
73
+ m.current = o.deltaDecorations(m.current, [{
74
+ range: new c.Range(l, 1, l, 1),
75
75
  options: {
76
76
  isWholeLine: !0,
77
77
  className: "daakia-paused-line",
78
- glyphMarginClassName: u,
79
- stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
78
+ glyphMarginClassName: s,
79
+ stickiness: c.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
80
80
  }
81
- }]), i.revealLineInCenter(g);
81
+ }]), o.revealLineInCenter(l);
82
82
  } else
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);
83
+ m.current = o.deltaDecorations(m.current, []);
84
+ }, [l, n]), A(() => () => {
85
+ b.current.forEach((o) => {
86
+ var c;
87
+ return (c = o == null ? void 0 : o.dispose) == null ? void 0 : c.call(o);
88
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", "");
89
+ }, []), { attach: z((o, c) => {
90
+ t.current = o, g.current = c;
91
+ const h = o.getDomNode();
92
+ if (h) {
93
+ const s = h.querySelector(".margin");
94
+ s && s.setAttribute("data-daakia-bp-gutter", "");
95
95
  }
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);
96
+ if (u) {
97
+ const s = o.onMouseDown((p) => {
98
+ var y;
99
+ if (p.event.leftButton && p.target.type === c.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
100
+ const k = (y = p.target.position) == null ? void 0 : y.lineNumber;
101
+ k && w(k) && u(k);
102
102
  }
103
103
  });
104
- b.current.push(u);
104
+ b.current.push(s);
105
105
  }
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 });
106
+ if (d) {
107
+ let s = null;
108
+ const p = o.onMouseDown((k) => {
109
+ var v;
110
+ if (k.event.rightButton && (k.target.type === c.editor.MouseTargetType.GUTTER_GLYPH_MARGIN || k.target.type === c.editor.MouseTargetType.GUTTER_LINE_NUMBERS || k.target.type === c.editor.MouseTargetType.GUTTER_LINE_DECORATIONS)) {
111
+ const D = (v = k.target.position) == null ? void 0 : v.lineNumber;
112
+ D && w(D) && (s = { line: D, x: k.event.posx, y: k.event.posy });
113
113
  }
114
114
  });
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());
115
+ b.current.push(p);
116
+ const y = o.getDomNode();
117
+ if (y) {
118
+ const k = (v) => {
119
+ s ? (v.preventDefault(), v.stopPropagation(), d(s.line, { x: s.x, y: s.y }), s = null) : v.target.closest("[data-daakia-bp-gutter]") && (v.preventDefault(), v.stopPropagation());
120
120
  };
121
- E.addEventListener("contextmenu", p, !0), b.current.push({ dispose: () => E.removeEventListener("contextmenu", p, !0) });
121
+ y.addEventListener("contextmenu", k, !0), b.current.push({ dispose: () => y.removeEventListener("contextmenu", k, !0) });
122
122
  }
123
123
  }
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
- if (N) {
132
- const M = N.getLineDecorations(w);
133
- if (!(M == null ? void 0 : M.some(
124
+ if (u) {
125
+ const s = o.onMouseMove((y) => {
126
+ var k;
127
+ if (y.target.type === c.editor.MouseTargetType.GUTTER_GLYPH_MARGIN) {
128
+ const v = (k = y.target.position) == null ? void 0 : k.lineNumber;
129
+ if (v && w(v)) {
130
+ const D = o.getModel();
131
+ if (D) {
132
+ const I = D.getLineDecorations(v);
133
+ if (!(I == null ? void 0 : I.some(
134
134
  (S) => {
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"));
135
+ var E, T, L, _;
136
+ return ((T = (E = S.options) == null ? void 0 : E.glyphMarginClassName) == null ? void 0 : T.startsWith("daakia-bp-glyph")) && !((_ = (L = S.options) == null ? void 0 : L.glyphMarginClassName) != null && _.includes("hover"));
137
137
  }
138
138
  ))) {
139
- h.current = i.deltaDecorations(h.current, [{
140
- range: new s.Range(w, 1, w, 1),
139
+ f.current = o.deltaDecorations(f.current, [{
140
+ range: new c.Range(v, 1, v, 1),
141
141
  options: {
142
142
  isWholeLine: !1,
143
- stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
143
+ stickiness: c.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 Te(n) {
150
150
  }
151
151
  }
152
152
  }
153
- h.current.length && (h.current = i.deltaDecorations(h.current, []));
153
+ f.current.length && (f.current = o.deltaDecorations(f.current, []));
154
154
  });
155
- b.current.push(u);
156
- const C = i.onMouseLeave(() => {
157
- h.current.length && (h.current = i.deltaDecorations(h.current, []));
155
+ b.current.push(s);
156
+ const p = o.onMouseLeave(() => {
157
+ f.current.length && (f.current = o.deltaDecorations(f.current, []));
158
158
  });
159
- b.current.push(C);
159
+ b.current.push(p);
160
160
  }
161
- if (t) {
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),
161
+ if (n) {
162
+ const s = [];
163
+ for (const p of n) {
164
+ const y = r == null ? void 0 : r.includes(p), k = i == null ? void 0 : i.includes(p);
165
+ let v = "daakia-bp-glyph";
166
+ y ? v = "daakia-bp-glyph--disabled" : k && (v = "daakia-bp-glyph--conditional"), s.push({
167
+ range: new c.Range(p, 1, p, 1),
168
168
  options: {
169
169
  isWholeLine: !0,
170
- className: E ? "" : "daakia-bp-line",
171
- stickiness: s.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
172
- glyphMarginClassName: w,
170
+ className: y ? "" : "daakia-bp-line",
171
+ stickiness: c.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
172
+ glyphMarginClassName: v,
173
173
  glyphMarginHoverMessage: {
174
- value: p ? "Conditional Breakpoint" : E ? "Disabled Breakpoint" : "Breakpoint"
174
+ value: k ? "Conditional Breakpoint" : y ? "Disabled Breakpoint" : "Breakpoint"
175
175
  }
176
176
  }
177
177
  });
178
178
  }
179
- f.current = i.deltaDecorations(f.current, u);
179
+ C.current = o.deltaDecorations(C.current, s);
180
180
  }
181
- }, [c, m, o, t, r, l]) };
181
+ }, [u, d, w, n, r, i]) };
182
182
  }
183
- const ie = {
183
+ const se = {
184
184
  navigateLine: null,
185
185
  setNavigateLine: () => {
186
186
  },
@@ -188,12 +188,12 @@ const ie = {
188
188
  status: "idle",
189
189
  variables: []
190
190
  };
191
- function W(n) {
192
- return n(ie);
191
+ function W(e) {
192
+ return e(se);
193
193
  }
194
- W.getState = () => ie;
195
- let H = !1;
196
- const K = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Set(), ve = /* @__PURE__ */ new Set([
194
+ W.getState = () => se;
195
+ let U = !1;
196
+ const V = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ new Set([
197
197
  "area",
198
198
  "base",
199
199
  "br",
@@ -208,26 +208,26 @@ const K = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Set(), ve = /* @__P
208
208
  "source",
209
209
  "track",
210
210
  "wbr"
211
- ]), xe = /<([_:a-zA-Z][-_:.\w]*)((?:"[^"]*"|'[^']*'|[^'">])*)>$/, V = /<\/?([_:a-zA-Z][-_:.\w]*)((?:"[^"]*"|'[^']*'|[^'">])*)>/g;
212
- function Se(n) {
213
- return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
211
+ ]), Re = /<([_:a-zA-Z][-_:.\w]*)((?:"[^"]*"|'[^']*'|[^'">])*)>$/, J = /<\/?([_:a-zA-Z][-_:.\w]*)((?:"[^"]*"|'[^']*'|[^'">])*)>/g;
212
+ function Ae(e) {
213
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
214
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);
215
+ function Le(e) {
216
+ const n = e.replace(/<!--[\s\S]*?-->/g, "").replace(/<!\[CDATA\[[\s\S]*?\]\]>/g, ""), r = [];
217
+ J.lastIndex = 0;
218
+ let i;
219
+ for (; (i = J.exec(n)) !== null; ) {
220
+ const [l, u, d] = i;
221
+ if (l.startsWith("</")) {
222
+ const t = r.lastIndexOf(u);
223
+ t !== -1 ? r.length = t : r.pop();
224
+ } else d.trimEnd().endsWith("/") || r.push(u);
225
225
  }
226
226
  return r.length ? r[r.length - 1] : null;
227
227
  }
228
- function J(n, t) {
229
- if (K.has(t)) return;
230
- K.add(t);
228
+ function Z(e, n) {
229
+ if (V.has(n)) return;
230
+ V.add(n);
231
231
  const r = {
232
232
  // Deliberately no { open: '<', close: '>' } here — matching VS Code's own
233
233
  // html/xml language configuration. Auto-inserting '>' would mean the user's
@@ -256,69 +256,70 @@ function J(n, t) {
256
256
  // Enter between <a>|</a> — open the pair onto three lines, caret indented.
257
257
  beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
258
258
  afterText: /^<\/([_:\w][_:\w\-.\d]*)\s*>$/i,
259
- action: { indentAction: n.languages.IndentAction.IndentOutdent }
259
+ action: { indentAction: e.languages.IndentAction.IndentOutdent }
260
260
  },
261
261
  {
262
262
  beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
263
- action: { indentAction: n.languages.IndentAction.Indent }
263
+ action: { indentAction: e.languages.IndentAction.Indent }
264
264
  }
265
265
  ],
266
266
  wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
267
267
  };
268
- let l = n.languages.setLanguageConfiguration(t, r);
269
- for (const g of [50, 250, 1e3])
268
+ let i = e.languages.setLanguageConfiguration(n, r);
269
+ for (const l of [50, 250, 1e3])
270
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);
271
+ var d;
272
+ const u = e.languages.setLanguageConfiguration(n, r);
273
+ (d = i == null ? void 0 : i.dispose) == null || d.call(i), i = u;
274
+ }, l);
275
275
  }
276
- function De(n, t) {
276
+ function Ie(e, n) {
277
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({
278
+ const i = e.onDidChangeModelContent((l) => {
279
+ var a;
280
+ if (r || l.isUndoing || l.isRedoing) return;
281
+ const u = e.getModel();
282
+ if (!u) return;
283
+ const d = u.getLanguageId();
284
+ if (d !== "xml" && d !== "html" || ((a = e.getOption) == null ? void 0 : a.call(e, n.editor.EditorOption.autoClosingBrackets)) === "never" || l.changes.length !== 1) return;
285
+ const t = l.changes[0];
286
+ if (t.text !== ">" && t.text !== "/") return;
287
+ const g = t.range.startLineNumber, C = t.range.startColumn + t.text.length, m = u.getValueInRange({
287
288
  startLineNumber: 1,
288
289
  startColumn: 1,
289
- endLineNumber: k,
290
- endColumn: f
290
+ endLineNumber: g,
291
+ endColumn: C
291
292
  });
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)
293
+ let f, b, w = 0;
294
+ if (t.text === ">") {
295
+ const o = Re.exec(m);
296
+ if (!o || o[2].trimEnd().endsWith("/") || d === "html" && De.has(o[1].toLowerCase())) return;
297
+ const c = u.getValueInRange({
298
+ startLineNumber: g,
299
+ startColumn: C,
300
+ endLineNumber: g,
301
+ endColumn: u.getLineMaxColumn(g)
301
302
  });
302
- if (new RegExp(`^\\s*</${Se(a[1])}\\s*>`).test(i)) return;
303
- h = `</${a[1]}>`, b = 0;
303
+ if (new RegExp(`^\\s*</${Ae(o[1])}\\s*>`).test(c)) return;
304
+ f = `</${o[1]}>`, b = 0;
304
305
  } 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);
306
+ if (!/<\/$/.test(m)) return;
307
+ const o = Le(m.slice(0, -2));
308
+ if (!o) return;
309
+ f = `${o}>`, b = f.length, u.getLineContent(g).charAt(C - 1) === ">" && (w = 1);
309
310
  }
310
311
  r = !0;
311
312
  try {
312
- n.executeEdits(
313
+ e.executeEdits(
313
314
  "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)]
315
+ [{ range: new n.Range(g, C, g, C + w), text: f, forceMoveMarkers: !1 }],
316
+ [new n.Selection(g, C + b, g, C + b)]
316
317
  );
317
318
  } finally {
318
319
  r = !1;
319
320
  }
320
321
  });
321
- n.onDidDispose(() => l.dispose());
322
+ e.onDidDispose(() => i.dispose());
322
323
  }
323
324
  const ae = {
324
325
  javascript: ".js",
@@ -335,351 +336,446 @@ const ae = {
335
336
  plaintext: ".txt",
336
337
  proto: ".proto"
337
338
  };
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++;
339
+ function Me(e) {
340
+ let r = 0, i = "";
341
+ const l = e.replace(/>\s*</g, "><").split(new RegExp("(?<=>)(?=<)"));
342
+ for (const u of l) {
343
+ const d = /^<\//.test(u), t = /\/>$/.test(u) || /^<!/.test(u) || /^<\?/.test(u);
344
+ d && (r = Math.max(0, r - 1)), i += " ".repeat(r) + u.trim() + `
345
+ `, !d && !t && /^<[^/!?]/.test(u) && r++;
345
346
  }
346
- return l.trimEnd();
347
+ return i.trimEnd();
347
348
  }
348
- function Le(n) {
349
- return n.split(`
350
- `).map((t) => t.trimEnd()).join(`
349
+ function Oe(e) {
350
+ return e.split(`
351
+ `).map((n) => n.trimEnd()).join(`
351
352
  `).replace(/\n{3,}/g, `
352
353
 
353
354
  `).trim();
354
355
  }
355
- function Ae(n) {
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;
357
- return n.replace(/\s+/g, " ").replace(t, `
356
+ function Be(e) {
357
+ const n = /\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;
358
+ return e.replace(/\s+/g, " ").replace(n, `
358
359
  $1`).split(`
359
360
  `).map((r) => r.trim()).filter((r) => r.length > 0).join(`
360
361
  `);
361
362
  }
362
- function Me({
363
- value: n,
364
- onChange: t,
363
+ function _e({
364
+ value: e,
365
+ onChange: n,
365
366
  language: r = "json",
366
- height: l = "200px",
367
- minHeight: g,
368
- readOnly: c = !1,
369
- placeholder: m,
370
- wordWrap: e = !0,
371
- size: k,
372
- fontSize: f,
373
- className: y = "",
374
- bordered: h = !1,
367
+ height: i = "200px",
368
+ minHeight: l,
369
+ readOnly: u = !1,
370
+ placeholder: d,
371
+ wordWrap: t = !0,
372
+ size: g,
373
+ fontSize: C,
374
+ className: m = "",
375
+ bordered: f = !1,
375
376
  onEditorMount: b,
376
- contextMenuMode: o = "native",
377
+ contextMenuMode: w = "native",
377
378
  contextMenuItems: a,
378
- editorOptions: i,
379
- accentColor: s
379
+ editorOptions: o,
380
+ accentColor: c
380
381
  }) {
381
- const d = Y(k), u = f ?? d.fontSize, C = P(), E = R(null), p = R([]), w = Q(
382
+ const h = X(g), s = C ?? h.fontSize, p = j(), y = R(null), k = R([]), v = ee(
382
383
  () => `inmemory://daakia/${crypto.randomUUID()}${ae[r] || ".txt"}`,
383
384
  [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;
391
- if (T) {
392
- const v = T.getModel();
393
- v && v.dispose();
385
+ ), D = typeof i == "number" ? `${i}px` : i, I = l ? `max(${D}, ${l}px)` : D;
386
+ A(() => () => {
387
+ k.current.forEach((T) => {
388
+ var L;
389
+ return (L = T == null ? void 0 : T.dispose) == null ? void 0 : L.call(T);
390
+ }), k.current = [];
391
+ const E = y.current;
392
+ if (E) {
393
+ const T = E.getModel();
394
+ T && T.dispose();
394
395
  }
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,
396
+ }, []), A(() => {
397
+ var E;
398
+ (E = y.current) == null || E.updateOptions({ placeholder: d });
399
+ }, [d]);
400
+ const B = (E, T) => {
401
+ y.current = E, k.current = [], ce(E, T, { language: r, value: e, placeholder: d, onEditorMount: b, contextMenuMode: w, autoClosing: q(o ?? {}) });
402
+ }, S = p === "light" ? "daakia-light" : "daakia-dark";
403
+ return /* @__PURE__ */ M(
404
+ Q,
404
405
  {
405
- height: "100%",
406
- language: r,
407
- path: w,
408
- value: n,
409
- theme: S,
410
- onChange: (T) => t == null ? void 0 : t(T ?? ""),
411
- onMount: B,
412
- options: se({ readOnly: c, fontSize: u, wordWrap: e, glyphMargin: !1, contextMenuMode: o, editorOptions: i, theme: S })
406
+ bordered: f,
407
+ containerHeight: I,
408
+ contextMenuMode: w,
409
+ contextMenuItems: a,
410
+ itemsAt: (E, T) => ue(y.current, E, T, !!u),
411
+ accentColor: c,
412
+ children: /* @__PURE__ */ M(
413
+ Y,
414
+ {
415
+ height: "100%",
416
+ language: r,
417
+ path: v,
418
+ value: e,
419
+ theme: S,
420
+ onChange: (E) => n == null ? void 0 : n(E ?? ""),
421
+ onMount: B,
422
+ options: le({ readOnly: u, fontSize: s, wordWrap: t, glyphMargin: !1, contextMenuMode: w, editorOptions: o, theme: S })
423
+ }
424
+ )
413
425
  }
414
- ) });
426
+ );
415
427
  }
416
- function Ie({
417
- value: n,
418
- onChange: t,
428
+ function Fe({
429
+ value: e,
430
+ onChange: n,
419
431
  language: r = "json",
420
- height: l = "200px",
421
- minHeight: g,
422
- readOnly: c = !1,
423
- placeholder: m,
424
- wordWrap: e = !0,
425
- size: k,
426
- fontSize: f,
427
- className: y = "",
428
- bordered: h = !1,
432
+ height: i = "200px",
433
+ minHeight: l,
434
+ readOnly: u = !1,
435
+ placeholder: d,
436
+ wordWrap: t = !0,
437
+ size: g,
438
+ fontSize: C,
439
+ className: m = "",
440
+ bordered: f = !1,
429
441
  breakpoints: b,
430
- disabledBreakpoints: o,
442
+ disabledBreakpoints: w,
431
443
  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
444
+ pausedLine: o,
445
+ onToggleBreakpoint: c,
446
+ onGlyphContextMenu: h,
447
+ onEditorMount: s,
448
+ contextMenuMode: p = "native",
449
+ contextMenuItems: y,
450
+ editorOptions: k,
451
+ accentColor: v
440
452
  }) {
441
- const N = Y(k), M = f ?? N.fontSize, B = P(), S = R(null), T = R([]), v = Q(
453
+ const D = X(g), I = C ?? D.fontSize, B = j(), S = R(null), E = R([]), T = ee(
442
454
  () => `inmemory://daakia/${crypto.randomUUID()}${ae[r] || ".txt"}`,
443
455
  [r]
444
- ), A = typeof l == "number" ? `${l}px` : l, F = g ? `max(${A}, ${g}px)` : A, { attach: ue } = Te({
456
+ ), L = typeof i == "number" ? `${i}px` : i, _ = l ? `max(${L}, ${l}px)` : L, { attach: ge } = Ne({
445
457
  breakpoints: b,
446
- disabledBreakpoints: o,
458
+ disabledBreakpoints: w,
447
459
  conditionalBreakpointLines: a,
448
- pausedLine: i,
449
- onToggleBreakpoint: s,
450
- onGlyphContextMenu: d
451
- }), _ = W((x) => x.navigateLine);
452
- L(() => () => {
453
- T.current.forEach((D) => {
460
+ pausedLine: o,
461
+ onToggleBreakpoint: c,
462
+ onGlyphContextMenu: h
463
+ }), F = W((x) => x.navigateLine);
464
+ A(() => () => {
465
+ E.current.forEach((N) => {
454
466
  var $;
455
- return ($ = D == null ? void 0 : D.dispose) == null ? void 0 : $.call(D);
456
- }), T.current = [];
467
+ return ($ = N == null ? void 0 : N.dispose) == null ? void 0 : $.call(N);
468
+ }), E.current = [];
457
469
  const x = S.current;
458
470
  if (x) {
459
- const D = x.getModel();
460
- D && D.dispose();
471
+ const N = x.getModel();
472
+ N && N.dispose();
461
473
  }
462
- }, []), L(() => {
474
+ }, []), A(() => {
463
475
  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 });
476
+ (x = S.current) == null || x.updateOptions({ placeholder: d });
477
+ }, [d]), A(() => {
478
+ !F || !S.current || !b || (S.current.revealLineInCenter(F), S.current.setPosition({ lineNumber: F, column: 1 }), W.getState().setNavigateLine(null));
479
+ }, [F, b]);
480
+ const de = (x, N) => {
481
+ S.current = x, E.current = [], ge(x, N), ce(x, N, { language: r, value: e, placeholder: d, onEditorMount: s, contextMenuMode: p, autoClosing: q(k ?? {}) });
470
482
  }, 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,
483
+ return /* @__PURE__ */ M(
484
+ Q,
473
485
  {
474
- height: "100%",
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 })
486
+ bordered: f,
487
+ containerHeight: _,
488
+ contextMenuMode: p,
489
+ contextMenuItems: y,
490
+ itemsAt: (x, N) => ue(S.current, x, N, !!u),
491
+ accentColor: v,
492
+ children: /* @__PURE__ */ M(
493
+ Y,
494
+ {
495
+ height: "100%",
496
+ language: r,
497
+ path: T,
498
+ value: e,
499
+ theme: G,
500
+ onChange: (x) => n == null ? void 0 : n(x ?? ""),
501
+ onMount: de,
502
+ options: le({ readOnly: u, fontSize: I, wordWrap: t, glyphMargin: !!c, contextMenuMode: p, editorOptions: k, theme: G })
503
+ }
504
+ )
482
505
  }
483
- ) });
506
+ );
484
507
  }
485
- function Oe({ debugSupported: n = !1, className: t = "", ...r }) {
486
- return n ? /* @__PURE__ */ I(Ie, { className: t, ...r }) : /* @__PURE__ */ I(Me, { className: t, ...r });
508
+ function We({ debugSupported: e = !1, className: n = "", ...r }) {
509
+ return e ? /* @__PURE__ */ M(Fe, { className: n, ...r }) : /* @__PURE__ */ M(_e, { className: n, ...r });
487
510
  }
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 ?? {};
511
+ function q(e) {
512
+ return !(e.autoClosing === !1 || typeof window < "u" && window.__DUI_NO_AUTOCLOSE__ === !0);
513
+ }
514
+ function le({ readOnly: e, fontSize: n, wordWrap: r, glyphMargin: i, contextMenuMode: l = "native", editorOptions: u, theme: d }) {
515
+ var C, m, f, b, w, a, o, c, h, s, p;
516
+ const t = u ?? {}, g = q(t);
491
517
  return {
492
518
  // Baked into construction options (not just the top-level <Editor theme=""> prop)
493
519
  // so Monaco applies it before its first paint — @monaco-editor/react creates the
494
520
  // editor first and only calls the global setTheme() afterward as a separate step,
495
521
  // which is what caused a flash of the default white 'vs' theme on every remount
496
522
  // (tab switch, subtab switch, new-tab-then-close) before this fix.
497
- theme: m,
523
+ theme: d,
498
524
  // ── Consumer-overridable defaults ────────────────────────────────────────
499
- lineNumbers: e.lineNumbers ?? "on",
500
- minimap: { enabled: e.minimap ?? !1 },
501
- scrollBeyondLastLine: e.scrollBeyondLastLine ?? !1,
502
- smoothScrolling: e.smoothScrolling ?? !1,
503
- mouseWheelZoom: e.mouseWheelZoom ?? !1,
504
- folding: e.folding ?? !0,
505
- showFoldingControls: e.showFoldingControls ?? "mouseover",
506
- tabSize: e.tabSize ?? 2,
507
- formatOnPaste: e.formatOnPaste ?? !0,
508
- formatOnType: e.formatOnType ?? !0,
509
- autoIndent: e.autoIndent ?? "full",
510
- renderWhitespace: e.renderWhitespace ?? "selection",
511
- matchBrackets: e.matchBrackets ?? "always",
512
- bracketPairColorization: { enabled: e.bracketPairColorization ?? !0 },
513
- colorDecorators: e.colorDecorators ?? !0,
514
- linkedEditing: e.linkedEditing ?? !0,
515
- copyWithSyntaxHighlighting: e.copyWithSyntaxHighlighting ?? !0,
516
- quickSuggestions: e.quickSuggestions ?? !0,
517
- suggestOnTriggerCharacters: e.suggestOnTriggerCharacters ?? !0,
518
- acceptSuggestionOnEnter: e.acceptSuggestionOnEnter ?? "on",
519
- hover: { enabled: e.hover ?? !0 },
520
- parameterHints: { enabled: e.parameterHints ?? !0 },
521
- codeLens: e.codeLens ?? !1,
522
- inlayHints: { enabled: e.inlayHints ?? !1 ? "on" : "off" },
523
- padding: { top: ((k = e.padding) == null ? void 0 : k.top) ?? 8, bottom: ((f = e.padding) == null ? void 0 : f.bottom) ?? 8 },
524
- ...e.cursorStyle && { cursorStyle: e.cursorStyle },
525
- ...e.cursorBlinking && { cursorBlinking: e.cursorBlinking },
526
- ...e.lineHeight && { lineHeight: e.lineHeight },
527
- ...e.letterSpacing && { letterSpacing: e.letterSpacing },
528
- ...e.rulers && { rulers: e.rulers },
529
- ...e.lineDecorationsWidth !== void 0 && { lineDecorationsWidth: e.lineDecorationsWidth },
530
- ...e.lineNumbersMinChars !== void 0 && { lineNumbersMinChars: e.lineNumbersMinChars },
525
+ lineNumbers: t.lineNumbers ?? "on",
526
+ minimap: { enabled: t.minimap ?? !1 },
527
+ scrollBeyondLastLine: t.scrollBeyondLastLine ?? !1,
528
+ smoothScrolling: t.smoothScrolling ?? !1,
529
+ mouseWheelZoom: t.mouseWheelZoom ?? !1,
530
+ folding: t.folding ?? !0,
531
+ showFoldingControls: t.showFoldingControls ?? "mouseover",
532
+ tabSize: t.tabSize ?? 2,
533
+ formatOnPaste: t.formatOnPaste ?? !0,
534
+ formatOnType: t.formatOnType ?? !0,
535
+ autoIndent: t.autoIndent ?? "full",
536
+ renderWhitespace: t.renderWhitespace ?? "selection",
537
+ matchBrackets: t.matchBrackets ?? "always",
538
+ bracketPairColorization: { enabled: t.bracketPairColorization ?? !0 },
539
+ colorDecorators: t.colorDecorators ?? !0,
540
+ linkedEditing: t.linkedEditing ?? !0,
541
+ copyWithSyntaxHighlighting: t.copyWithSyntaxHighlighting ?? !0,
542
+ quickSuggestions: t.quickSuggestions ?? !0,
543
+ suggestOnTriggerCharacters: t.suggestOnTriggerCharacters ?? !0,
544
+ acceptSuggestionOnEnter: t.acceptSuggestionOnEnter ?? "on",
545
+ hover: { enabled: t.hover ?? !0 },
546
+ parameterHints: { enabled: t.parameterHints ?? !0 },
547
+ codeLens: t.codeLens ?? !1,
548
+ inlayHints: { enabled: t.inlayHints ?? !1 ? "on" : "off" },
549
+ padding: { top: ((C = t.padding) == null ? void 0 : C.top) ?? 8, bottom: ((m = t.padding) == null ? void 0 : m.bottom) ?? 8 },
550
+ ...t.cursorStyle && { cursorStyle: t.cursorStyle },
551
+ ...t.cursorBlinking && { cursorBlinking: t.cursorBlinking },
552
+ ...t.lineHeight && { lineHeight: t.lineHeight },
553
+ ...t.letterSpacing && { letterSpacing: t.letterSpacing },
554
+ ...t.rulers && { rulers: t.rulers },
555
+ ...t.lineDecorationsWidth !== void 0 && { lineDecorationsWidth: t.lineDecorationsWidth },
556
+ ...t.lineNumbersMinChars !== void 0 && { lineNumbersMinChars: t.lineNumbersMinChars },
531
557
  // ── Prop-level overrides (top-level EditorView props win over editorOptions) ─
532
- readOnly: n,
533
- fontSize: t,
534
- wordWrap: e.wordWrap ?? (r ? "on" : "off"),
558
+ readOnly: e,
559
+ fontSize: n,
560
+ wordWrap: t.wordWrap ?? (r ? "on" : "off"),
535
561
  // ── DUI structural — never overridable ──────────────────────────────────
536
562
  automaticLayout: !0,
537
- glyphMargin: l,
538
- renderLineHighlight: e.renderLineHighlight ?? (l ? "line" : "none"),
563
+ glyphMargin: i,
564
+ renderLineHighlight: t.renderLineHighlight ?? (i ? "line" : "none"),
539
565
  fixedOverflowWidgets: !0,
540
- contextmenu: g === "native",
566
+ contextmenu: l === "native",
541
567
  overviewRulerLanes: 0,
542
568
  hideCursorInOverviewRuler: !0,
543
569
  overviewRulerBorder: !1,
544
570
  scrollbar: {
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,
548
- horizontalScrollbarSize: ((o = e.scrollbar) == null ? void 0 : o.horizontalScrollbarSize) ?? 6
571
+ vertical: ((f = t.scrollbar) == null ? void 0 : f.vertical) ?? "auto",
572
+ horizontal: ((b = t.scrollbar) == null ? void 0 : b.horizontal) ?? "auto",
573
+ verticalScrollbarSize: ((w = t.scrollbar) == null ? void 0 : w.verticalScrollbarSize) ?? 6,
574
+ horizontalScrollbarSize: ((a = t.scrollbar) == null ? void 0 : a.horizontalScrollbarSize) ?? 6
549
575
  },
550
- fontFamily: e.fontFamily ?? 'Menlo, Monaco, "Courier New", monospace',
551
- autoClosingBrackets: "always",
552
- autoClosingQuotes: "always",
553
- autoClosingDelete: "always",
554
- autoSurround: "languageDefined",
576
+ fontFamily: t.fontFamily ?? 'Menlo, Monaco, "Courier New", monospace',
577
+ /*
578
+ Closing brackets, quotes and tags for you — on by default, and off when
579
+ the caller says so.
580
+
581
+ These were hard-coded to 'always' in two places, one of them an
582
+ `updateOptions` that runs after mount, so a consumer setting them to
583
+ 'never' on the instance had them set straight back. Anything driving this
584
+ editor a character at a time then typed its own closing brace onto the
585
+ one Monaco had already inserted: `{"a": 1}}`, and a SOAP envelope with
586
+ every tag doubled.
587
+ */
588
+ autoClosingBrackets: g ? "always" : "never",
589
+ autoClosingQuotes: g ? "always" : "never",
590
+ autoClosingDelete: g ? "always" : "never",
591
+ autoSurround: g ? "languageDefined" : "never",
555
592
  guides: { bracketPairs: !0, indentation: !0 },
556
593
  suggest: {
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 }
594
+ showKeywords: ((o = t.suggest) == null ? void 0 : o.showKeywords) ?? !0,
595
+ showSnippets: ((c = t.suggest) == null ? void 0 : c.showSnippets) ?? !0,
596
+ showValues: ((h = t.suggest) == null ? void 0 : h.showValues) ?? !0,
597
+ showProperties: ((s = t.suggest) == null ? void 0 : s.showProperties) ?? !0,
598
+ ...((p = t.suggest) == null ? void 0 : p.showIcons) !== void 0 && { showIcons: t.suggest.showIcons }
562
599
  }
563
600
  };
564
601
  }
565
- function le(n, t, { language: r, value: l, placeholder: g, onEditorMount: c, contextMenuMode: m = "native" }) {
566
- const e = () => n.layout();
567
- e(), requestAnimationFrame(e), setTimeout(e, 50), setTimeout(e, 200);
568
- const k = n.getContainerDomNode().parentElement;
569
- if (k) {
570
- const o = new ResizeObserver(e);
571
- o.observe(k), n.onDidDispose(() => o.disconnect());
602
+ function Pe(e, n, r) {
603
+ var m, f, b;
604
+ const i = (m = e == null ? void 0 : e.getModel) == null ? void 0 : m.call(e), l = (b = (f = e == null ? void 0 : e.getTargetAtClientPoint) == null ? void 0 : f.call(e, n, r)) == null ? void 0 : b.position;
605
+ if (!i || !l) return [];
606
+ const u = i.getLanguageId(), d = i.getValue(), t = i.getOffsetAt(l), g = u === "json" ? me(d, t) : u === "xml" ? he(d, t) : [];
607
+ if (!g.length) return [];
608
+ const C = [...g].reverse();
609
+ return [{
610
+ id: "dui.copyPath",
611
+ label: u === "json" ? "Copy JSON path" : "Copy XPath",
612
+ children: C.map((w, a) => ({
613
+ id: `dui.copyPath.${a}`,
614
+ label: w,
615
+ // The one you are most likely to want, named as such rather than left
616
+ // to be inferred from its position.
617
+ description: a === 0 ? "what you clicked" : void 0,
618
+ onClick: () => {
619
+ var o;
620
+ (o = navigator.clipboard) == null || o.writeText(w);
621
+ }
622
+ }))
623
+ }];
624
+ }
625
+ function je(e, n) {
626
+ var d, t;
627
+ const r = (d = e == null ? void 0 : e.getModel) == null ? void 0 : d.call(e);
628
+ if (!r) return [];
629
+ const i = (t = e.getSelection) == null ? void 0 : t.call(e), l = i && !i.isEmpty() ? r.getValueInRange(i) : "", u = [
630
+ {
631
+ id: "dui.copy",
632
+ label: "Copy",
633
+ shortcut: "Ctrl+C",
634
+ disabled: !l,
635
+ onClick: () => {
636
+ var g;
637
+ l && ((g = navigator.clipboard) == null || g.writeText(l));
638
+ }
639
+ },
640
+ {
641
+ id: "dui.selectAll",
642
+ label: "Select all",
643
+ shortcut: "Ctrl+A",
644
+ onClick: () => {
645
+ e.setSelection(r.getFullModelRange()), e.focus();
646
+ }
647
+ }
648
+ ];
649
+ return n || (u.unshift({
650
+ id: "dui.cut",
651
+ label: "Cut",
652
+ shortcut: "Ctrl+X",
653
+ disabled: !l,
654
+ onClick: () => {
655
+ var g;
656
+ l && ((g = navigator.clipboard) == null || g.writeText(l), e.executeEdits("dui.cut", [{ range: i, text: "" }]), e.focus());
657
+ }
658
+ }), u.push({
659
+ id: "dui.paste",
660
+ label: "Paste",
661
+ shortcut: "Ctrl+V",
662
+ onClick: async () => {
663
+ var m, f;
664
+ const g = await ((f = (m = navigator.clipboard) == null ? void 0 : m.readText) == null ? void 0 : f.call(m));
665
+ if (g == null) return;
666
+ const C = e.getSelection() ?? r.getFullModelRange();
667
+ e.executeEdits("dui.paste", [{ range: C, text: g }]), e.focus();
668
+ }
669
+ })), u;
670
+ }
671
+ function ue(e, n, r, i) {
672
+ const l = Pe(e, n, r), u = je(e, i);
673
+ return l.length ? [...l, { id: "dui.sep", label: "", separator: !0 }, ...u] : u;
674
+ }
675
+ function ce(e, n, { language: r, value: i, placeholder: l, onEditorMount: u, contextMenuMode: d = "native", autoClosing: t = !0 }) {
676
+ const g = () => e.layout();
677
+ g(), requestAnimationFrame(g), setTimeout(g, 50), setTimeout(g, 200);
678
+ const C = e.getContainerDomNode().parentElement;
679
+ if (C) {
680
+ const a = new ResizeObserver(g);
681
+ a.observe(C), e.onDidDispose(() => a.disconnect());
572
682
  }
573
- n.updateOptions({
574
- autoClosingBrackets: "always",
575
- autoClosingQuotes: "always",
576
- autoClosingDelete: "always",
577
- autoSurround: "languageDefined",
683
+ e.updateOptions({
684
+ autoClosingBrackets: t ? "always" : "never",
685
+ autoClosingQuotes: t ? "always" : "never",
686
+ autoClosingDelete: t ? "always" : "never",
687
+ autoSurround: t ? "languageDefined" : "never",
578
688
  autoIndent: "full"
579
689
  });
580
- const f = t.KeyMod, y = t.KeyCode;
581
- n.addAction({
690
+ const m = n.KeyMod, f = n.KeyCode;
691
+ e.addAction({
582
692
  id: "daakia.clipboard.copy",
583
693
  label: "Copy",
584
- keybindings: [f.CtrlCmd | y.KeyC],
585
- run: (o) => {
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)) || "");
694
+ keybindings: [m.CtrlCmd | f.KeyC],
695
+ run: (a) => {
696
+ var c, h;
697
+ const o = a.getSelection();
698
+ if (o && !o.isEmpty())
699
+ navigator.clipboard.writeText(((c = a.getModel()) == null ? void 0 : c.getValueInRange(o)) || "");
590
700
  else {
591
- const d = o.getPosition();
592
- d && navigator.clipboard.writeText((((s = o.getModel()) == null ? void 0 : s.getLineContent(d.lineNumber)) || "") + `
701
+ const s = a.getPosition();
702
+ s && navigator.clipboard.writeText((((h = a.getModel()) == null ? void 0 : h.getLineContent(s.lineNumber)) || "") + `
593
703
  `);
594
704
  }
595
705
  }
596
- }), n.addAction({
706
+ }), e.addAction({
597
707
  id: "daakia.clipboard.cut",
598
708
  label: "Cut",
599
- keybindings: [f.CtrlCmd | y.KeyX],
600
- run: (o) => {
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: "" }]);
709
+ keybindings: [m.CtrlCmd | f.KeyX],
710
+ run: (a) => {
711
+ var c;
712
+ const o = a.getSelection();
713
+ if (o && !o.isEmpty())
714
+ navigator.clipboard.writeText(((c = a.getModel()) == null ? void 0 : c.getValueInRange(o)) || ""), a.executeEdits("cut", [{ range: o, text: "" }]);
605
715
  else {
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: "" }]));
611
- }
612
- }
613
- }
614
- }), n.addAction({
615
- id: "daakia.clipboard.paste",
616
- label: "Paste",
617
- keybindings: [f.CtrlCmd | y.KeyV],
618
- run: async (o) => {
619
- try {
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 }]);
716
+ const h = a.getPosition();
717
+ if (h) {
718
+ const s = a.getModel();
719
+ s && (navigator.clipboard.writeText(s.getLineContent(h.lineNumber) + `
720
+ `), a.executeEdits("cut", [{ range: new n.Range(h.lineNumber, 1, h.lineNumber + 1, 1), text: "" }]));
624
721
  }
625
- } catch {
626
722
  }
627
723
  }
628
- }), n.addAction({
724
+ }), e.addAction({
629
725
  id: "daakia.clipboard.selectAll",
630
726
  label: "Select All",
631
- keybindings: [f.CtrlCmd | y.KeyA],
632
- run: (o) => {
633
- const a = o.getModel();
634
- a && o.setSelection(a.getFullModelRange());
727
+ keybindings: [m.CtrlCmd | f.KeyA],
728
+ run: (a) => {
729
+ const o = a.getModel();
730
+ o && a.setSelection(o.getFullModelRange());
635
731
  }
636
- }), n.addAction({
732
+ }), e.addAction({
637
733
  id: "daakia.format.document",
638
734
  label: "Format Document",
639
- keybindings: [f.Shift | f.Alt | y.KeyF],
735
+ keybindings: [m.Shift | m.Alt | f.KeyF],
640
736
  contextMenuGroupId: "modification",
641
737
  contextMenuOrder: 1.5,
642
- run: async (o) => {
643
- var s;
644
- const a = o.getModel();
645
- if (!a) return;
646
- const i = a.getLanguageId();
647
- if (i === "xml" || i === "html")
738
+ run: async (a) => {
739
+ var h;
740
+ const o = a.getModel();
741
+ if (!o) return;
742
+ const c = o.getLanguageId();
743
+ if (c === "xml" || c === "html")
648
744
  try {
649
- const d = a.getValue(), u = Re(d);
650
- u !== d && o.executeEdits("daakia.format", [{ range: a.getFullModelRange(), text: u }]);
745
+ const s = o.getValue(), p = Me(s);
746
+ p !== s && a.executeEdits("daakia.format", [{ range: o.getFullModelRange(), text: p }]);
651
747
  } catch {
652
748
  }
653
- else if (i === "yaml")
749
+ else if (c === "yaml")
654
750
  try {
655
- const d = a.getValue(), u = Le(d);
656
- u !== d && o.executeEdits("daakia.format", [{ range: a.getFullModelRange(), text: u }]);
751
+ const s = o.getValue(), p = Oe(s);
752
+ p !== s && a.executeEdits("daakia.format", [{ range: o.getFullModelRange(), text: p }]);
657
753
  } catch {
658
754
  }
659
- else if (i === "sql")
755
+ else if (c === "sql")
660
756
  try {
661
- const d = a.getValue(), u = Ae(d);
662
- u !== d && o.executeEdits("daakia.format", [{ range: a.getFullModelRange(), text: u }]);
757
+ const s = o.getValue(), p = Be(s);
758
+ p !== s && a.executeEdits("daakia.format", [{ range: o.getFullModelRange(), text: p }]);
663
759
  } catch {
664
760
  }
665
761
  else
666
- await ((s = o.getAction("editor.action.formatDocument")) == null ? void 0 : s.run());
762
+ await ((h = a.getAction("editor.action.formatDocument")) == null ? void 0 : h.run());
667
763
  }
668
- }), n.addAction({
764
+ }), e.addAction({
669
765
  id: "daakia.findAndReplace",
670
766
  label: "Find and Replace",
671
- keybindings: [f.CtrlCmd | f.Shift | y.KeyH],
767
+ keybindings: [m.CtrlCmd | m.Shift | f.KeyH],
672
768
  contextMenuGroupId: "navigation",
673
769
  contextMenuOrder: 1.5,
674
770
  run: () => {
675
- var o;
676
- return (o = n.getAction("editor.action.startFindReplaceAction")) == null ? void 0 : o.run();
771
+ var a;
772
+ return (a = e.getAction("editor.action.startFindReplaceAction")) == null ? void 0 : a.run();
677
773
  }
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, {
774
+ }), Z(n, "xml"), Z(n, "html");
775
+ const b = e.getModel();
776
+ if (b) {
777
+ const a = b.getLanguageId();
778
+ a !== "xml" && a !== "html" && !K.has(a) && (K.add(a), n.languages.setLanguageConfiguration(a, {
683
779
  autoClosingPairs: [
684
780
  { open: "{", close: "}" },
685
781
  { open: "[", close: "]" },
@@ -697,7 +793,7 @@ function le(n, t, { language: r, value: l, placeholder: g, onEditorMount: c, con
697
793
  ]
698
794
  }));
699
795
  }
700
- De(n, t), t.languages.getLanguages().some((o) => o.id === "graphql") || (t.languages.register({ id: "graphql" }), t.languages.setMonarchTokensProvider("graphql", {
796
+ Ie(e, n), n.languages.getLanguages().some((a) => a.id === "graphql") || (n.languages.register({ id: "graphql" }), n.languages.setMonarchTokensProvider("graphql", {
701
797
  keywords: ["type", "input", "enum", "union", "interface", "scalar", "schema", "query", "mutation", "subscription", "fragment", "on", "extend", "implements", "directive", "repeatable"],
702
798
  typeKeywords: ["String", "Int", "Float", "Boolean", "ID"],
703
799
  operators: ["!", "=", "|", "&", "..."],
@@ -719,62 +815,62 @@ function le(n, t, { language: r, value: l, placeholder: g, onEditorMount: c, con
719
815
  [/@[a-zA-Z_]\w*/, "annotation"]
720
816
  ]
721
817
  }
722
- })), r === "javascript" && (H || (t.languages.typescript.javascriptDefaults.addExtraLib(Ee, "dk-globals.d.ts"), H = !0), t.languages.registerCompletionItemProvider("javascript", {
818
+ })), r === "javascript" && (U || (n.languages.typescript.javascriptDefaults.addExtraLib(xe, "dk-globals.d.ts"), U = !0), n.languages.registerCompletionItemProvider("javascript", {
723
819
  triggerCharacters: ["."],
724
- provideCompletionItems: (o, a) => {
725
- const i = o.getValueInRange({
726
- startLineNumber: a.lineNumber,
820
+ provideCompletionItems: (a, o) => {
821
+ const c = a.getValueInRange({
822
+ startLineNumber: o.lineNumber,
727
823
  startColumn: 1,
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) ? {
824
+ endLineNumber: o.lineNumber,
825
+ endColumn: o.column
826
+ }), h = Se();
827
+ if (h.length > 0) return { suggestions: h };
828
+ const s = { startLineNumber: o.lineNumber, endLineNumber: o.lineNumber, startColumn: o.column, endColumn: o.column };
829
+ return /\bconsole\.\s*$/.test(c) ? {
734
830
  suggestions: [
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 }
831
+ { label: "log", kind: n.languages.CompletionItemKind.Function, insertText: "log(${1})", insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Log output", range: s },
832
+ { label: "info", kind: n.languages.CompletionItemKind.Function, insertText: "info(${1})", insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Info output", range: s },
833
+ { label: "warn", kind: n.languages.CompletionItemKind.Function, insertText: "warn(${1})", insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Warning output", range: s },
834
+ { label: "error", kind: n.languages.CompletionItemKind.Function, insertText: "error(${1})", insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Error output", range: s },
835
+ { label: "debug", kind: n.languages.CompletionItemKind.Function, insertText: "debug(${1})", insertTextRules: n.languages.CompletionItemInsertTextRule.InsertAsSnippet, detail: "Debug output", range: s }
740
836
  ]
741
837
  } : { suggestions: [] };
742
838
  }
743
- })), !l && g && n.updateOptions({ placeholder: g }), c == null || c(n, t), n.updateOptions({ contextmenu: m === "native" });
839
+ })), !i && l && e.updateOptions({ placeholder: l }), u == null || u(e, n), e.updateOptions({ contextmenu: d === "native" });
744
840
  }
745
- function Be({
746
- original: n,
747
- modified: t,
841
+ function qe({
842
+ original: e,
843
+ modified: n,
748
844
  language: r = "sql",
749
- height: l = 300,
750
- readOnly: g = !0,
751
- renderSideBySide: c = !0,
752
- wordWrap: m = !1,
753
- fontSize: e = 12,
754
- theme: k,
755
- onMount: f
845
+ height: i = 300,
846
+ readOnly: l = !0,
847
+ renderSideBySide: u = !0,
848
+ wordWrap: d = !1,
849
+ fontSize: t = 12,
850
+ theme: g,
851
+ onMount: C
756
852
  }) {
757
- const y = P(), h = k ?? (y === "light" ? "vs" : "vs-dark"), b = typeof l == "number" ? `${l}px` : l;
758
- return /* @__PURE__ */ I(
759
- ge,
853
+ const m = j(), f = g ?? (m === "light" ? "vs" : "vs-dark"), b = typeof i == "number" ? `${i}px` : i;
854
+ return /* @__PURE__ */ M(
855
+ fe,
760
856
  {
761
857
  height: b,
762
858
  language: r,
763
- theme: h,
764
- original: n,
765
- modified: t,
766
- onMount: f,
859
+ theme: f,
860
+ original: e,
861
+ modified: n,
862
+ onMount: C,
767
863
  options: {
768
- readOnly: g,
769
- renderSideBySide: c,
864
+ readOnly: l,
865
+ renderSideBySide: u,
770
866
  // Monaco silently drops to inline/unified rendering below its own
771
867
  // width threshold regardless of renderSideBySide — this diff editor
772
868
  // is often mounted inside narrow panels (e.g. Merkle's expanded
773
869
  // table row), so pin side-by-side explicitly instead of letting it
774
870
  // auto-collapse.
775
871
  useInlineViewWhenSpaceIsLimited: !1,
776
- wordWrap: m ? "on" : "off",
777
- fontSize: e,
872
+ wordWrap: d ? "on" : "off",
873
+ fontSize: t,
778
874
  automaticLayout: !0,
779
875
  minimap: { enabled: !1 },
780
876
  scrollBeyondLastLine: !1,
@@ -786,8 +882,8 @@ function Be({
786
882
  );
787
883
  }
788
884
  window.MonacoEnvironment = {
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();
885
+ getWorker(e, n) {
886
+ return n === "json" ? new we() : n === "html" || n === "handlebars" || n === "razor" ? new Ee() : n === "typescript" || n === "javascript" ? new Te() : new ve();
791
887
  }
792
888
  };
793
889
  O.editor.defineTheme("daakia-dark", {
@@ -857,34 +953,34 @@ O.editor.defineTheme("daakia-dark", {
857
953
  focusBorder: "#6366f1"
858
954
  }
859
955
  });
860
- q.setCompilerOptions({
861
- target: oe.ESNext,
862
- module: ne.ESNext,
956
+ P.setCompilerOptions({
957
+ target: re.ESNext,
958
+ module: oe.ESNext,
863
959
  allowNonTsExtensions: !0,
864
960
  allowJs: !0,
865
961
  checkJs: !0,
866
962
  strict: !1,
867
963
  noEmit: !0,
868
964
  esModuleInterop: !0,
869
- moduleResolution: te.NodeJs,
870
- jsx: ee.React
965
+ moduleResolution: ne.NodeJs,
966
+ jsx: te.React
871
967
  });
872
- q.setDiagnosticsOptions({
968
+ P.setDiagnosticsOptions({
873
969
  noSemanticValidation: !1,
874
970
  noSyntaxValidation: !1
875
971
  });
876
- q.setEagerModelSync(!0);
877
- re.setEagerModelSync(!0);
878
- re.setCompilerOptions({
879
- target: oe.ESNext,
880
- module: ne.ESNext,
972
+ P.setEagerModelSync(!0);
973
+ ie.setEagerModelSync(!0);
974
+ ie.setCompilerOptions({
975
+ target: re.ESNext,
976
+ module: oe.ESNext,
881
977
  allowNonTsExtensions: !0,
882
978
  allowJs: !0,
883
979
  strict: !1,
884
980
  noEmit: !0,
885
981
  esModuleInterop: !0,
886
- moduleResolution: te.NodeJs,
887
- jsx: ee.React
982
+ moduleResolution: ne.NodeJs,
983
+ jsx: te.React
888
984
  });
889
985
  O.editor.defineTheme("daakia-light", {
890
986
  base: "vs",
@@ -944,16 +1040,16 @@ O.editor.defineTheme("daakia-light", {
944
1040
  focusBorder: "#6366f1"
945
1041
  }
946
1042
  });
947
- ce.config({ monaco: O });
1043
+ pe.config({ monaco: O });
948
1044
  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");
1045
+ be(We);
1046
+ Ce(qe);
1047
+ ke();
1048
+ function Ye(e) {
1049
+ O.editor.setTheme(e === "dark" ? "daakia-dark" : "daakia-light");
954
1050
  }
955
1051
  export {
956
- He as applyMonacoTheme,
1052
+ Ye as applyMonacoTheme,
957
1053
  O as monaco
958
1054
  };
959
1055
  //# sourceMappingURL=monaco-setup.js.map