@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.
- package/dist/assets/DuiShowcase-C18KoqHP.css +1 -0
- package/dist/assets/{DuiShowcase-CSkP-vdJ.js → DuiShowcase-DwihGCxO.js} +1377 -1359
- package/dist/assets/{index-DQdlwLhi.js → index-D9rPjVPP.js} +2 -2
- package/dist/chunks/{daakia-icons-BpwUOdSO.js → daakia-icons-DYLRx0Yi.js} +1096 -1053
- package/dist/chunks/daakia-icons-DYLRx0Yi.js.map +1 -0
- package/dist/chunks/doc-path-D2_JUEIe.js +695 -0
- package/dist/chunks/doc-path-D2_JUEIe.js.map +1 -0
- package/dist/icons/daakia-icons.d.ts +24 -0
- package/dist/index.html +1 -1
- package/dist/index.js +20939 -17293
- package/dist/index.js.map +1 -1
- package/dist/lib/components/button/AIButtonView.d.ts +10 -1
- package/dist/lib/components/button/ActionButtonView.d.ts +42 -0
- package/dist/lib/components/button/BookmarkButtonView.d.ts +10 -1
- package/dist/lib/components/button/FabView.d.ts +10 -1
- package/dist/lib/components/button/FollowButtonView.d.ts +10 -1
- package/dist/lib/components/button/HoldToConfirmView.d.ts +10 -1
- package/dist/lib/components/button/LikeButtonView.d.ts +10 -1
- package/dist/lib/components/button/MorphingIconButtonView.d.ts +10 -1
- package/dist/lib/components/button/SegmentedView.d.ts +10 -1
- package/dist/lib/components/button/ThemeToggleView.d.ts +10 -1
- package/dist/lib/components/button/VoteWidgetView.d.ts +10 -1
- package/dist/lib/components/chips/ChipView.d.ts +32 -1
- package/dist/lib/components/chips/CommandChipView.d.ts +10 -1
- package/dist/lib/components/display/BadgeChipView.d.ts +25 -0
- package/dist/lib/components/display/DonutView.d.ts +35 -0
- package/dist/lib/components/display/EmptyStateView.d.ts +33 -1
- package/dist/lib/components/display/FileBrowserView.d.ts +143 -0
- package/dist/lib/components/display/FileBrowserView.test.d.ts +1 -0
- package/dist/lib/components/display/FindingCardView.d.ts +36 -0
- package/dist/lib/components/display/FlameGraphView.d.ts +32 -0
- package/dist/lib/components/display/GroupHeaderView.d.ts +28 -0
- package/dist/lib/components/display/IssueCardSkeletonView.d.ts +28 -0
- package/dist/lib/components/display/IssueCardView.d.ts +40 -0
- package/dist/lib/components/display/LaneChartView.d.ts +46 -0
- package/dist/lib/components/display/LineDiffView.d.ts +25 -0
- package/dist/lib/components/display/PriorityMarkView.d.ts +20 -0
- package/dist/lib/components/display/SetupOptionView.d.ts +56 -0
- package/dist/lib/components/display/SunburstView.d.ts +32 -0
- package/dist/lib/components/display/SwimlaneChartView.d.ts +48 -0
- package/dist/lib/components/display/TableSkeletonView.d.ts +34 -0
- package/dist/lib/components/display/hierarchy-layout.d.ts +114 -0
- package/dist/lib/components/display/hierarchy-layout.test.d.ts +1 -0
- package/dist/lib/components/display/lane-scale.d.ts +67 -0
- package/dist/lib/components/display/lane-scale.test.d.ts +1 -0
- package/dist/lib/components/display/line-diff.d.ts +42 -0
- package/dist/lib/components/input/AvatarUploadView.d.ts +10 -1
- package/dist/lib/components/input/CalendarView.d.ts +10 -1
- package/dist/lib/components/input/CascaderView.d.ts +10 -1
- package/dist/lib/components/input/ChatInputView.d.ts +10 -1
- package/dist/lib/components/input/CheckboxView.d.ts +10 -1
- package/dist/lib/components/input/ChecklistView.d.ts +10 -1
- package/dist/lib/components/input/ColorPickerView.d.ts +10 -1
- package/dist/lib/components/input/ComboBoxView.d.ts +10 -1
- package/dist/lib/components/input/DateInputView.d.ts +10 -1
- package/dist/lib/components/input/DateRangePickerView.d.ts +10 -1
- package/dist/lib/components/input/DateTimeInputView.d.ts +10 -1
- package/dist/lib/components/input/DialKnobInputView.d.ts +10 -1
- package/dist/lib/components/input/DurationInputView.d.ts +10 -1
- package/dist/lib/components/input/EditorView.d.ts +8 -0
- package/dist/lib/components/input/EditorView.shell.d.ts +9 -1
- package/dist/lib/components/input/EmojiPickerView.d.ts +10 -1
- package/dist/lib/components/input/FeedbackWidgetView.d.ts +10 -1
- package/dist/lib/components/input/FileDropzoneView.d.ts +10 -1
- package/dist/lib/components/input/FilterInputView.d.ts +25 -0
- package/dist/lib/components/input/FloatingLabelInputView.d.ts +10 -1
- package/dist/lib/components/input/FormDataTableView.d.ts +10 -1
- package/dist/lib/components/input/GhostTypingPlaceholderView.d.ts +10 -1
- package/dist/lib/components/input/HiddenKeyValueItemView.d.ts +10 -1
- package/dist/lib/components/input/HighlightedInputView.d.ts +12 -1
- package/dist/lib/components/input/IconPickerView.d.ts +10 -1
- package/dist/lib/components/input/InlineEditTextView.d.ts +10 -1
- package/dist/lib/components/input/InviteInputView.d.ts +10 -1
- package/dist/lib/components/input/KeyValueTableRowView.d.ts +10 -1
- package/dist/lib/components/input/KeyValueTableView.d.ts +10 -1
- package/dist/lib/components/input/MarkdownEditorView.d.ts +30 -0
- package/dist/lib/components/input/MaskedInputView.d.ts +10 -1
- package/dist/lib/components/input/MentionInputView.d.ts +10 -1
- package/dist/lib/components/input/MergedInputView.d.ts +10 -1
- package/dist/lib/components/input/NpsSurveyView.d.ts +10 -1
- package/dist/lib/components/input/OtpInputView.d.ts +10 -1
- package/dist/lib/components/input/PhoneInputView.d.ts +10 -1
- package/dist/lib/components/input/PickerView.d.ts +10 -1
- package/dist/lib/components/input/PriorityPickerView.d.ts +10 -1
- package/dist/lib/components/input/RadioCardView.d.ts +10 -1
- package/dist/lib/components/input/RadioGroupView.d.ts +10 -1
- package/dist/lib/components/input/RangeSliderView.d.ts +10 -1
- package/dist/lib/components/input/RatingView.d.ts +10 -1
- package/dist/lib/components/input/RichTextToolbarView.d.ts +10 -1
- package/dist/lib/components/input/RoleSelectView.d.ts +10 -1
- package/dist/lib/components/input/SearchFieldView.d.ts +33 -0
- package/dist/lib/components/input/SegmentedControlView.d.ts +20 -1
- package/dist/lib/components/input/SelectInputView.d.ts +32 -1
- package/dist/lib/components/input/SelectTextInputView.d.ts +12 -1
- package/dist/lib/components/input/ShortcutRecorderView.d.ts +10 -1
- package/dist/lib/components/input/SliderView.d.ts +10 -1
- package/dist/lib/components/input/SpectrumSliderView.d.ts +10 -1
- package/dist/lib/components/input/StepperInputView.d.ts +10 -1
- package/dist/lib/components/input/SwatchPickerView.d.ts +38 -0
- package/dist/lib/components/input/SwitchGroupView.d.ts +10 -1
- package/dist/lib/components/input/TabView.d.ts +10 -1
- package/dist/lib/components/input/TagInputView.d.ts +10 -1
- package/dist/lib/components/input/TextInputView.d.ts +9 -0
- package/dist/lib/components/input/ThemeCardSelectorView.d.ts +10 -1
- package/dist/lib/components/input/TimeWheelView.d.ts +10 -1
- package/dist/lib/components/input/TimeZoneSelectView.d.ts +40 -0
- package/dist/lib/components/input/TimeZoneSelectView.test.d.ts +1 -0
- package/dist/lib/components/input/TogglePillView.d.ts +51 -0
- package/dist/lib/components/input/ToggleSwitchView.d.ts +10 -1
- package/dist/lib/components/input/TransferListView.d.ts +10 -1
- package/dist/lib/components/input/TreeSelectView.d.ts +10 -1
- package/dist/lib/components/input/WizardStepperView.d.ts +10 -1
- package/dist/lib/components/input/doc-path.d.ts +52 -0
- package/dist/lib/components/input/doc-path.test.d.ts +1 -0
- package/dist/lib/components/input/markdown-serialise.d.ts +23 -0
- package/dist/lib/components/input/select-position.test.d.ts +1 -0
- package/dist/lib/components/layout/PathBreadcrumbView.d.ts +67 -0
- package/dist/lib/components/layout/PathBreadcrumbView.test.d.ts +1 -0
- package/dist/lib/components/layout/SplitPanelView.d.ts +26 -1
- package/dist/lib/components/modal/ActionSheetView.d.ts +10 -1
- package/dist/lib/components/modal/AlertDialogView.d.ts +10 -1
- package/dist/lib/components/modal/BottomSheetView.d.ts +10 -1
- package/dist/lib/components/modal/CommandPaletteView.d.ts +10 -1
- package/dist/lib/components/modal/ContextMenuView.d.ts +19 -1
- package/dist/lib/components/modal/DrawerView.d.ts +10 -1
- package/dist/lib/components/modal/InfoPopupView.d.ts +13 -1
- package/dist/lib/components/modal/ModalView.d.ts +19 -3
- package/dist/lib/components/modal/NotificationCenterView.d.ts +10 -1
- package/dist/lib/components/modal/PopoverView.d.ts +10 -1
- package/dist/lib/components/modal/SheetView.d.ts +31 -0
- package/dist/lib/components/modal/SpotlightTourView.d.ts +10 -1
- package/dist/lib/components/modal/StackedToastDeckView.d.ts +10 -1
- package/dist/lib/components/modal/sheet-drag.d.ts +60 -0
- package/dist/lib/components/modal/sheet-drag.test.d.ts +1 -0
- package/dist/lib/components/tabs/PilledTabView.d.ts +10 -1
- package/dist/lib/components/tabs/TabBarView.d.ts +10 -1
- package/dist/lib/components/tabs/UnderlineTabsView.d.ts +41 -0
- package/dist/lib/components/testid.test.d.ts +1 -0
- package/dist/lib/core/IconSize.d.ts +37 -0
- package/dist/lib/core/TerminalPalette.d.ts +81 -0
- package/dist/lib/core/TerminalPaletteFile.d.ts +61 -0
- package/dist/lib/core/TerminalPaletteFile.test.d.ts +1 -0
- package/dist/lib/index.d.ts +65 -0
- package/dist/monaco-setup.js +589 -493
- package/dist/monaco-setup.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/editor.js +1 -1
- package/package.json +5 -3
- package/dist/assets/DuiShowcase-CRLG9S4N.css +0 -1
- package/dist/chunks/EditorView.shell-DWGMOgiy.js +0 -510
- package/dist/chunks/EditorView.shell-DWGMOgiy.js.map +0 -1
- package/dist/chunks/daakia-icons-BpwUOdSO.js.map +0 -1
package/dist/monaco-setup.js
CHANGED
|
@@ -1,146 +1,146 @@
|
|
|
1
|
-
import
|
|
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
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useState as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { javascriptDefaults as
|
|
11
|
-
function
|
|
12
|
-
var
|
|
13
|
-
const
|
|
14
|
-
return
|
|
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
|
|
17
|
-
const [
|
|
18
|
-
return
|
|
19
|
-
const r = () =>
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
return document.body &&
|
|
23
|
-
|
|
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
|
-
}, []),
|
|
25
|
+
}, []), e;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
27
|
+
const xe = "";
|
|
28
|
+
function Se(e, n, r) {
|
|
29
29
|
return [];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ne(e) {
|
|
32
32
|
const {
|
|
33
|
-
breakpoints:
|
|
33
|
+
breakpoints: n,
|
|
34
34
|
disabledBreakpoints: r,
|
|
35
|
-
conditionalBreakpointLines:
|
|
36
|
-
pausedLine:
|
|
37
|
-
onToggleBreakpoint:
|
|
38
|
-
onGlyphContextMenu:
|
|
39
|
-
} =
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
const
|
|
43
|
-
return !
|
|
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
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
for (const
|
|
51
|
-
if (
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
range: new
|
|
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:
|
|
59
|
-
stickiness:
|
|
60
|
-
glyphMarginClassName:
|
|
58
|
+
className: p ? "" : "daakia-bp-line",
|
|
59
|
+
stickiness: c.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
60
|
+
glyphMarginClassName: k,
|
|
61
61
|
glyphMarginHoverMessage: {
|
|
62
|
-
value:
|
|
62
|
+
value: y ? "Conditional Breakpoint" : p ? "Disabled Breakpoint" : "Breakpoint"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
}, [
|
|
69
|
-
const
|
|
70
|
-
if (!(!
|
|
71
|
-
if (
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
range: new
|
|
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:
|
|
79
|
-
stickiness:
|
|
78
|
+
glyphMarginClassName: s,
|
|
79
|
+
stickiness: c.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
|
|
80
80
|
}
|
|
81
|
-
}]),
|
|
81
|
+
}]), o.revealLineInCenter(l);
|
|
82
82
|
} else
|
|
83
|
-
|
|
84
|
-
}, [
|
|
85
|
-
b.current.forEach((
|
|
86
|
-
var
|
|
87
|
-
return (
|
|
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:
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
const
|
|
94
|
-
|
|
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 (
|
|
97
|
-
const
|
|
98
|
-
var
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
|
|
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(
|
|
104
|
+
b.current.push(s);
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
107
|
-
let
|
|
108
|
-
const
|
|
109
|
-
var
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
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(
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
const
|
|
119
|
-
|
|
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
|
-
|
|
121
|
+
y.addEventListener("contextmenu", k, !0), b.current.push({ dispose: () => y.removeEventListener("contextmenu", k, !0) });
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
var
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const
|
|
131
|
-
if (
|
|
132
|
-
const
|
|
133
|
-
if (!(
|
|
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
|
|
136
|
-
return ((
|
|
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
|
-
|
|
140
|
-
range: new
|
|
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:
|
|
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
|
-
|
|
153
|
+
f.current.length && (f.current = o.deltaDecorations(f.current, []));
|
|
154
154
|
});
|
|
155
|
-
b.current.push(
|
|
156
|
-
const
|
|
157
|
-
|
|
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(
|
|
159
|
+
b.current.push(p);
|
|
160
160
|
}
|
|
161
|
-
if (
|
|
162
|
-
const
|
|
163
|
-
for (const
|
|
164
|
-
const
|
|
165
|
-
let
|
|
166
|
-
|
|
167
|
-
range: new
|
|
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:
|
|
171
|
-
stickiness:
|
|
172
|
-
glyphMarginClassName:
|
|
170
|
+
className: y ? "" : "daakia-bp-line",
|
|
171
|
+
stickiness: c.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
|
172
|
+
glyphMarginClassName: v,
|
|
173
173
|
glyphMarginHoverMessage: {
|
|
174
|
-
value:
|
|
174
|
+
value: k ? "Conditional Breakpoint" : y ? "Disabled Breakpoint" : "Breakpoint"
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
C.current = o.deltaDecorations(C.current, s);
|
|
180
180
|
}
|
|
181
|
-
}, [
|
|
181
|
+
}, [u, d, w, n, r, i]) };
|
|
182
182
|
}
|
|
183
|
-
const
|
|
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(
|
|
192
|
-
return
|
|
191
|
+
function W(e) {
|
|
192
|
+
return e(se);
|
|
193
193
|
}
|
|
194
|
-
W.getState = () =>
|
|
195
|
-
let
|
|
196
|
-
const
|
|
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
|
-
]),
|
|
212
|
-
function
|
|
213
|
-
return
|
|
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
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
let
|
|
219
|
-
for (; (
|
|
220
|
-
const [
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
} else
|
|
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
|
|
229
|
-
if (
|
|
230
|
-
|
|
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:
|
|
259
|
+
action: { indentAction: e.languages.IndentAction.IndentOutdent }
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
beforeText: /<([_:\w][_:\w\-.\d]*)([^/>]*(?!\/)>)\s*$/i,
|
|
263
|
-
action: { indentAction:
|
|
263
|
+
action: { indentAction: e.languages.IndentAction.Indent }
|
|
264
264
|
}
|
|
265
265
|
],
|
|
266
266
|
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g
|
|
267
267
|
};
|
|
268
|
-
let
|
|
269
|
-
for (const
|
|
268
|
+
let i = e.languages.setLanguageConfiguration(n, r);
|
|
269
|
+
for (const l of [50, 250, 1e3])
|
|
270
270
|
setTimeout(() => {
|
|
271
|
-
var
|
|
272
|
-
const
|
|
273
|
-
(
|
|
274
|
-
},
|
|
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
|
|
276
|
+
function Ie(e, n) {
|
|
277
277
|
let r = !1;
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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:
|
|
290
|
-
endColumn:
|
|
290
|
+
endLineNumber: g,
|
|
291
|
+
endColumn: C
|
|
291
292
|
});
|
|
292
|
-
let
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
296
|
-
const
|
|
297
|
-
startLineNumber:
|
|
298
|
-
startColumn:
|
|
299
|
-
endLineNumber:
|
|
300
|
-
endColumn:
|
|
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*</${
|
|
303
|
-
|
|
303
|
+
if (new RegExp(`^\\s*</${Ae(o[1])}\\s*>`).test(c)) return;
|
|
304
|
+
f = `</${o[1]}>`, b = 0;
|
|
304
305
|
} else {
|
|
305
|
-
if (!/<\/$/.test(
|
|
306
|
-
const
|
|
307
|
-
if (!
|
|
308
|
-
|
|
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
|
-
|
|
313
|
+
e.executeEdits(
|
|
313
314
|
"daakia.autoCloseTag",
|
|
314
|
-
[{ range: new
|
|
315
|
-
[new
|
|
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
|
-
|
|
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
|
|
339
|
-
let r = 0,
|
|
340
|
-
const
|
|
341
|
-
for (const
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
`, !
|
|
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
|
|
347
|
+
return i.trimEnd();
|
|
347
348
|
}
|
|
348
|
-
function
|
|
349
|
-
return
|
|
350
|
-
`).map((
|
|
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
|
|
356
|
-
const
|
|
357
|
-
return
|
|
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
|
|
363
|
-
value:
|
|
364
|
-
onChange:
|
|
363
|
+
function _e({
|
|
364
|
+
value: e,
|
|
365
|
+
onChange: n,
|
|
365
366
|
language: r = "json",
|
|
366
|
-
height:
|
|
367
|
-
minHeight:
|
|
368
|
-
readOnly:
|
|
369
|
-
placeholder:
|
|
370
|
-
wordWrap:
|
|
371
|
-
size:
|
|
372
|
-
fontSize:
|
|
373
|
-
className:
|
|
374
|
-
bordered:
|
|
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:
|
|
377
|
+
contextMenuMode: w = "native",
|
|
377
378
|
contextMenuItems: a,
|
|
378
|
-
editorOptions:
|
|
379
|
-
accentColor:
|
|
379
|
+
editorOptions: o,
|
|
380
|
+
accentColor: c
|
|
380
381
|
}) {
|
|
381
|
-
const
|
|
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
|
-
),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
var
|
|
388
|
-
return (
|
|
389
|
-
}),
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
const
|
|
393
|
-
|
|
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
|
-
}, []),
|
|
396
|
-
var
|
|
397
|
-
(
|
|
398
|
-
}, [
|
|
399
|
-
const B = (
|
|
400
|
-
|
|
401
|
-
}, S =
|
|
402
|
-
return /* @__PURE__ */
|
|
403
|
-
|
|
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
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
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
|
|
417
|
-
value:
|
|
418
|
-
onChange:
|
|
428
|
+
function Fe({
|
|
429
|
+
value: e,
|
|
430
|
+
onChange: n,
|
|
419
431
|
language: r = "json",
|
|
420
|
-
height:
|
|
421
|
-
minHeight:
|
|
422
|
-
readOnly:
|
|
423
|
-
placeholder:
|
|
424
|
-
wordWrap:
|
|
425
|
-
size:
|
|
426
|
-
fontSize:
|
|
427
|
-
className:
|
|
428
|
-
bordered:
|
|
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:
|
|
442
|
+
disabledBreakpoints: w,
|
|
431
443
|
conditionalBreakpointLines: a,
|
|
432
|
-
pausedLine:
|
|
433
|
-
onToggleBreakpoint:
|
|
434
|
-
onGlyphContextMenu:
|
|
435
|
-
onEditorMount:
|
|
436
|
-
contextMenuMode:
|
|
437
|
-
contextMenuItems:
|
|
438
|
-
editorOptions:
|
|
439
|
-
accentColor:
|
|
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
|
|
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
|
-
),
|
|
456
|
+
), L = typeof i == "number" ? `${i}px` : i, _ = l ? `max(${L}, ${l}px)` : L, { attach: ge } = Ne({
|
|
445
457
|
breakpoints: b,
|
|
446
|
-
disabledBreakpoints:
|
|
458
|
+
disabledBreakpoints: w,
|
|
447
459
|
conditionalBreakpointLines: a,
|
|
448
|
-
pausedLine:
|
|
449
|
-
onToggleBreakpoint:
|
|
450
|
-
onGlyphContextMenu:
|
|
451
|
-
}),
|
|
452
|
-
|
|
453
|
-
|
|
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 ($ =
|
|
456
|
-
}),
|
|
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
|
|
460
|
-
|
|
471
|
+
const N = x.getModel();
|
|
472
|
+
N && N.dispose();
|
|
461
473
|
}
|
|
462
|
-
}, []),
|
|
474
|
+
}, []), A(() => {
|
|
463
475
|
var x;
|
|
464
|
-
(x = S.current) == null || x.updateOptions({ placeholder:
|
|
465
|
-
}, [
|
|
466
|
-
!
|
|
467
|
-
}, [
|
|
468
|
-
const de = (x,
|
|
469
|
-
S.current = x,
|
|
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__ */
|
|
472
|
-
|
|
483
|
+
return /* @__PURE__ */ M(
|
|
484
|
+
Q,
|
|
473
485
|
{
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
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
|
|
486
|
-
return
|
|
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
|
|
489
|
-
|
|
490
|
-
|
|
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:
|
|
523
|
+
theme: d,
|
|
498
524
|
// ── Consumer-overridable defaults ────────────────────────────────────────
|
|
499
|
-
lineNumbers:
|
|
500
|
-
minimap: { enabled:
|
|
501
|
-
scrollBeyondLastLine:
|
|
502
|
-
smoothScrolling:
|
|
503
|
-
mouseWheelZoom:
|
|
504
|
-
folding:
|
|
505
|
-
showFoldingControls:
|
|
506
|
-
tabSize:
|
|
507
|
-
formatOnPaste:
|
|
508
|
-
formatOnType:
|
|
509
|
-
autoIndent:
|
|
510
|
-
renderWhitespace:
|
|
511
|
-
matchBrackets:
|
|
512
|
-
bracketPairColorization: { enabled:
|
|
513
|
-
colorDecorators:
|
|
514
|
-
linkedEditing:
|
|
515
|
-
copyWithSyntaxHighlighting:
|
|
516
|
-
quickSuggestions:
|
|
517
|
-
suggestOnTriggerCharacters:
|
|
518
|
-
acceptSuggestionOnEnter:
|
|
519
|
-
hover: { enabled:
|
|
520
|
-
parameterHints: { enabled:
|
|
521
|
-
codeLens:
|
|
522
|
-
inlayHints: { enabled:
|
|
523
|
-
padding: { top: ((
|
|
524
|
-
...
|
|
525
|
-
...
|
|
526
|
-
...
|
|
527
|
-
...
|
|
528
|
-
...
|
|
529
|
-
...
|
|
530
|
-
...
|
|
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:
|
|
533
|
-
fontSize:
|
|
534
|
-
wordWrap:
|
|
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:
|
|
538
|
-
renderLineHighlight:
|
|
563
|
+
glyphMargin: i,
|
|
564
|
+
renderLineHighlight: t.renderLineHighlight ?? (i ? "line" : "none"),
|
|
539
565
|
fixedOverflowWidgets: !0,
|
|
540
|
-
contextmenu:
|
|
566
|
+
contextmenu: l === "native",
|
|
541
567
|
overviewRulerLanes: 0,
|
|
542
568
|
hideCursorInOverviewRuler: !0,
|
|
543
569
|
overviewRulerBorder: !1,
|
|
544
570
|
scrollbar: {
|
|
545
|
-
vertical: ((
|
|
546
|
-
horizontal: ((
|
|
547
|
-
verticalScrollbarSize: ((
|
|
548
|
-
horizontalScrollbarSize: ((
|
|
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:
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
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: ((
|
|
558
|
-
showSnippets: ((
|
|
559
|
-
showValues: ((
|
|
560
|
-
showProperties: ((
|
|
561
|
-
...((
|
|
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
|
|
566
|
-
|
|
567
|
-
e
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
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
|
-
|
|
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
|
|
581
|
-
|
|
690
|
+
const m = n.KeyMod, f = n.KeyCode;
|
|
691
|
+
e.addAction({
|
|
582
692
|
id: "daakia.clipboard.copy",
|
|
583
693
|
label: "Copy",
|
|
584
|
-
keybindings: [
|
|
585
|
-
run: (
|
|
586
|
-
var
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
navigator.clipboard.writeText(((
|
|
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
|
|
592
|
-
|
|
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
|
-
}),
|
|
706
|
+
}), e.addAction({
|
|
597
707
|
id: "daakia.clipboard.cut",
|
|
598
708
|
label: "Cut",
|
|
599
|
-
keybindings: [
|
|
600
|
-
run: (
|
|
601
|
-
var
|
|
602
|
-
const
|
|
603
|
-
if (
|
|
604
|
-
navigator.clipboard.writeText(((
|
|
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
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
|
|
610
|
-
`),
|
|
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
|
-
}),
|
|
724
|
+
}), e.addAction({
|
|
629
725
|
id: "daakia.clipboard.selectAll",
|
|
630
726
|
label: "Select All",
|
|
631
|
-
keybindings: [
|
|
632
|
-
run: (
|
|
633
|
-
const
|
|
634
|
-
|
|
727
|
+
keybindings: [m.CtrlCmd | f.KeyA],
|
|
728
|
+
run: (a) => {
|
|
729
|
+
const o = a.getModel();
|
|
730
|
+
o && a.setSelection(o.getFullModelRange());
|
|
635
731
|
}
|
|
636
|
-
}),
|
|
732
|
+
}), e.addAction({
|
|
637
733
|
id: "daakia.format.document",
|
|
638
734
|
label: "Format Document",
|
|
639
|
-
keybindings: [
|
|
735
|
+
keybindings: [m.Shift | m.Alt | f.KeyF],
|
|
640
736
|
contextMenuGroupId: "modification",
|
|
641
737
|
contextMenuOrder: 1.5,
|
|
642
|
-
run: async (
|
|
643
|
-
var
|
|
644
|
-
const
|
|
645
|
-
if (!
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
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
|
|
650
|
-
|
|
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 (
|
|
749
|
+
else if (c === "yaml")
|
|
654
750
|
try {
|
|
655
|
-
const
|
|
656
|
-
|
|
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 (
|
|
755
|
+
else if (c === "sql")
|
|
660
756
|
try {
|
|
661
|
-
const
|
|
662
|
-
|
|
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 ((
|
|
762
|
+
await ((h = a.getAction("editor.action.formatDocument")) == null ? void 0 : h.run());
|
|
667
763
|
}
|
|
668
|
-
}),
|
|
764
|
+
}), e.addAction({
|
|
669
765
|
id: "daakia.findAndReplace",
|
|
670
766
|
label: "Find and Replace",
|
|
671
|
-
keybindings: [
|
|
767
|
+
keybindings: [m.CtrlCmd | m.Shift | f.KeyH],
|
|
672
768
|
contextMenuGroupId: "navigation",
|
|
673
769
|
contextMenuOrder: 1.5,
|
|
674
770
|
run: () => {
|
|
675
|
-
var
|
|
676
|
-
return (
|
|
771
|
+
var a;
|
|
772
|
+
return (a = e.getAction("editor.action.startFindReplaceAction")) == null ? void 0 : a.run();
|
|
677
773
|
}
|
|
678
|
-
}),
|
|
679
|
-
const
|
|
680
|
-
if (
|
|
681
|
-
const
|
|
682
|
-
|
|
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
|
-
|
|
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" && (
|
|
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: (
|
|
725
|
-
const
|
|
726
|
-
startLineNumber:
|
|
820
|
+
provideCompletionItems: (a, o) => {
|
|
821
|
+
const c = a.getValueInRange({
|
|
822
|
+
startLineNumber: o.lineNumber,
|
|
727
823
|
startColumn: 1,
|
|
728
|
-
endLineNumber:
|
|
729
|
-
endColumn:
|
|
730
|
-
}),
|
|
731
|
-
if (
|
|
732
|
-
const
|
|
733
|
-
return /\bconsole\.\s*$/.test(
|
|
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:
|
|
736
|
-
{ label: "info", kind:
|
|
737
|
-
{ label: "warn", kind:
|
|
738
|
-
{ label: "error", kind:
|
|
739
|
-
{ label: "debug", kind:
|
|
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
|
-
})), !
|
|
839
|
+
})), !i && l && e.updateOptions({ placeholder: l }), u == null || u(e, n), e.updateOptions({ contextmenu: d === "native" });
|
|
744
840
|
}
|
|
745
|
-
function
|
|
746
|
-
original:
|
|
747
|
-
modified:
|
|
841
|
+
function qe({
|
|
842
|
+
original: e,
|
|
843
|
+
modified: n,
|
|
748
844
|
language: r = "sql",
|
|
749
|
-
height:
|
|
750
|
-
readOnly:
|
|
751
|
-
renderSideBySide:
|
|
752
|
-
wordWrap:
|
|
753
|
-
fontSize:
|
|
754
|
-
theme:
|
|
755
|
-
onMount:
|
|
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
|
|
758
|
-
return /* @__PURE__ */
|
|
759
|
-
|
|
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:
|
|
764
|
-
original:
|
|
765
|
-
modified:
|
|
766
|
-
onMount:
|
|
859
|
+
theme: f,
|
|
860
|
+
original: e,
|
|
861
|
+
modified: n,
|
|
862
|
+
onMount: C,
|
|
767
863
|
options: {
|
|
768
|
-
readOnly:
|
|
769
|
-
renderSideBySide:
|
|
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:
|
|
777
|
-
fontSize:
|
|
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(
|
|
790
|
-
return
|
|
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
|
-
|
|
861
|
-
target:
|
|
862
|
-
module:
|
|
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:
|
|
870
|
-
jsx:
|
|
965
|
+
moduleResolution: ne.NodeJs,
|
|
966
|
+
jsx: te.React
|
|
871
967
|
});
|
|
872
|
-
|
|
968
|
+
P.setDiagnosticsOptions({
|
|
873
969
|
noSemanticValidation: !1,
|
|
874
970
|
noSyntaxValidation: !1
|
|
875
971
|
});
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
target:
|
|
880
|
-
module:
|
|
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:
|
|
887
|
-
jsx:
|
|
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
|
-
|
|
1043
|
+
pe.config({ monaco: O });
|
|
948
1044
|
window.monaco = O;
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
function
|
|
953
|
-
O.editor.setTheme(
|
|
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
|
-
|
|
1052
|
+
Ye as applyMonacoTheme,
|
|
957
1053
|
O as monaco
|
|
958
1054
|
};
|
|
959
1055
|
//# sourceMappingURL=monaco-setup.js.map
|