@nice2dev/ui 1.4.20 → 1.4.22

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 (42) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/NiceCodeEditor-CBgbzwjx.cjs +297 -0
  3. package/dist/NiceGantt-Drl4gvw9.cjs +1 -0
  4. package/dist/{NiceGantt.doc-B6YZcJvG.cjs → NiceGantt.doc-DTv0r7bP.cjs} +2 -2
  5. package/dist/{NiceMention-DhaTUqvR.cjs → NiceMention-D330ovOt.cjs} +1 -1
  6. package/dist/NiceModuleLifecyclePanel-jckyVqqt.cjs +1 -0
  7. package/dist/NiceWindow-DQyf5wat.cjs +1 -0
  8. package/dist/{core-lazy-BhQxFuLf.cjs → core-lazy-CUnBYI-T.cjs} +1 -1
  9. package/dist/display/NiceDocumentApprovalFlow.mjs +67 -89
  10. package/dist/display/NiceLeaderboard.mjs +47 -40
  11. package/dist/display/NiceQuestCard.mjs +93 -76
  12. package/dist/docs/NiceGantt.doc.json.mjs +9 -9
  13. package/dist/documentation/utils.mjs +1 -1
  14. package/dist/editors/rich/NiceCodeEditor.mjs +525 -504
  15. package/dist/editors.cjs +1 -1
  16. package/dist/index.cjs +99 -94
  17. package/dist/index.d.ts +63 -2
  18. package/dist/index.mjs +778 -776
  19. package/dist/navigation/NiceMenu.mjs +249 -248
  20. package/dist/navigation.cjs +1 -1
  21. package/dist/navigation.d.ts +6 -0
  22. package/dist/overlays/NiceResponsiveBox.mjs +51 -24
  23. package/dist/overlays/NiceTutorial.mjs +136 -127
  24. package/dist/overlays.cjs +1 -1
  25. package/dist/overlays.d.ts +25 -2
  26. package/dist/planning/NiceGantt.mjs +130 -121
  27. package/dist/planning/NiceStepper.mjs +36 -35
  28. package/dist/style.css +2 -2
  29. package/dist/tools/NiceDraggable.mjs +44 -29
  30. package/dist/tools/NiceGitManager.mjs +5 -0
  31. package/dist/tools/NiceSortable.mjs +66 -48
  32. package/dist/tools/NiceSpeechToText.mjs +67 -52
  33. package/dist/tools/NiceValidationBuilder.mjs +210 -119
  34. package/dist/tools/NiceViewRegistry.mjs +67 -34
  35. package/dist/workflow/NiceTaskInbox.mjs +14 -12
  36. package/package.json +4 -4
  37. package/dist/NiceBottomSheet.doc-keq-Fzlz.cjs +0 -8
  38. package/dist/NiceCodeEditor-DhdjnDLV.cjs +0 -289
  39. package/dist/NiceGantt-BygumlaY.cjs +0 -1
  40. package/dist/NiceModuleLifecyclePanel-DAIbzfZd.cjs +0 -1
  41. package/dist/NiceWindow-BklnkBpu.cjs +0 -1
  42. package/dist/docs/NiceBottomSheet.doc.json.mjs +0 -32
@@ -1,6 +1,6 @@
1
- import { jsxs as W, jsx as o } from "react/jsx-runtime";
2
- import { useNiceTranslation as ke, useControllableState as de, NiceTutorialButton as tt, resolveTutorial as rt, NiceIcon as O, createTabEscape as We, useThemeIsDark as ot } from "@nice2dev/ui-core";
3
- import { forwardRef as nt, useRef as v, useState as D, useMemo as Te, useEffect as S, useImperativeHandle as it, useId as ct, useCallback as Oe } from "react";
1
+ import { jsxs as z, jsx as n } from "react/jsx-runtime";
2
+ import { useNiceTranslation as ke, useControllableState as de, NiceTutorialButton as tt, resolveTutorial as rt, NiceIcon as P, createTabEscape as We, useThemeIsDark as ot } from "@nice2dev/ui-core";
3
+ import { forwardRef as nt, useRef as v, useState as V, useMemo as Te, useEffect as N, useImperativeHandle as it, useId as ct, useCallback as Oe } from "react";
4
4
  import { injectStyleOnce as ye } from "../../utility/injectStyleOnce.mjs";
5
5
  const at = [
6
6
  {
@@ -12,272 +12,277 @@ const at = [
12
12
  placement: "auto"
13
13
  }
14
14
  ];
15
- let re = null, ce = null;
16
- const dt = "0.45.0", De = `https://cdn.jsdelivr.net/npm/monaco-editor@${dt}/min`, be = `${De}/vs`, Re = 15e3;
15
+ let oe = null, ae = null;
16
+ const st = "0.45.0", De = `https://cdn.jsdelivr.net/npm/monaco-editor@${st}/min`, be = `${De}/vs`, Re = 15e3;
17
17
  function Ie() {
18
- const r = window;
19
- if (r.MonacoEnvironment?.getWorkerUrl)
18
+ const o = window;
19
+ if (o.MonacoEnvironment?.getWorkerUrl)
20
20
  return;
21
- const i = `self.MonacoEnvironment={baseUrl:'${De}/'};importScripts('${be}/base/worker/workerMain.js');`, d = URL.createObjectURL(new Blob([i], { type: "text/javascript" }));
22
- r.MonacoEnvironment = {
23
- getWorkerUrl: () => d
21
+ const c = `self.MonacoEnvironment={baseUrl:'${De}/'};importScripts('${be}/base/worker/workerMain.js');`, s = URL.createObjectURL(new Blob([c], { type: "text/javascript" }));
22
+ o.MonacoEnvironment = {
23
+ getWorkerUrl: () => s
24
24
  };
25
25
  }
26
- function se(r) {
27
- if (r !== "auto")
28
- return r;
26
+ function le(o) {
27
+ if (o !== "auto")
28
+ return o;
29
29
  if (typeof document > "u")
30
30
  return "vs";
31
- const i = document.documentElement.dataset.theme;
32
- return i === "dark" ? "vs-dark" : i === "light" ? "vs" : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "vs-dark" : "vs";
31
+ const c = document.documentElement.dataset.theme;
32
+ return c === "dark" ? "vs-dark" : c === "light" ? "vs" : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "vs-dark" : "vs";
33
33
  }
34
34
  const Pe = "nice-auto";
35
- let oe;
36
- function st(r) {
37
- if (!r || typeof document > "u" || (oe === void 0 && (oe = document.createElement("canvas").getContext("2d")), !oe))
35
+ let ne;
36
+ function dt(o) {
37
+ if (!o || typeof document > "u" || (ne === void 0 && (ne = document.createElement("canvas").getContext("2d")), !ne))
38
38
  return null;
39
- const i = "#010203";
40
- oe.fillStyle = i, oe.fillStyle = r;
41
- const d = String(oe.fillStyle);
42
- if (d === i && r.trim().toLowerCase() !== i)
39
+ const c = "#010203";
40
+ ne.fillStyle = c, ne.fillStyle = o;
41
+ const s = String(ne.fillStyle);
42
+ if (s === c && o.trim().toLowerCase() !== c)
43
43
  return null;
44
- if (d.startsWith("#"))
45
- return d;
46
- const t = d.match(/rgba?\(([^)]+)\)/);
44
+ if (s.startsWith("#"))
45
+ return s;
46
+ const t = s.match(/rgba?\(([^)]+)\)/);
47
47
  if (!t)
48
48
  return null;
49
- const [u, C, x, p = 1] = t[1].split(",").map((n) => parseFloat(n)), b = (n) => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, "0");
50
- return `#${b(u)}${b(C)}${b(x)}${p < 1 ? b(p * 255) : ""}`;
49
+ const [u, x, C, p = 1] = t[1].split(",").map((i) => parseFloat(i)), f = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
50
+ return `#${f(u)}${f(x)}${f(C)}${p < 1 ? f(p * 255) : ""}`;
51
51
  }
52
- function lt(r) {
53
- const i = parseInt(r.slice(1, 3), 16), d = parseInt(r.slice(3, 5), 16), t = parseInt(r.slice(5, 7), 16);
54
- return (0.299 * i + 0.587 * d + 0.114 * t) / 255;
52
+ function lt(o) {
53
+ const c = parseInt(o.slice(1, 3), 16), s = parseInt(o.slice(3, 5), 16), t = parseInt(o.slice(5, 7), 16);
54
+ return (0.299 * c + 0.587 * s + 0.114 * t) / 255;
55
55
  }
56
- function le(r, i, d) {
57
- if (i !== "auto" || !d || typeof getComputedStyle > "u")
58
- return se(i);
59
- const t = getComputedStyle(d), u = (...L) => {
60
- for (const R of L) {
61
- const f = st(t.getPropertyValue(R).trim());
62
- if (f)
63
- return f;
56
+ function ue(o, c, s) {
57
+ if (c !== "auto" || !s || typeof getComputedStyle > "u")
58
+ return le(c);
59
+ const t = getComputedStyle(s), u = (...R) => {
60
+ for (const A of R) {
61
+ const g = dt(t.getPropertyValue(A).trim());
62
+ if (g)
63
+ return g;
64
64
  }
65
65
  return null;
66
- }, C = u("--nice-bg-primary", "--bg-primary"), x = u("--nice-text-primary", "--text-primary");
67
- if (!C || !x)
68
- return se(i);
69
- const p = u("--nice-bg-secondary", "--bg-secondary") ?? C, b = u("--nice-text-secondary", "--text-secondary") ?? x, n = u("--nice-color-primary", "--primary") ?? x, B = u("--nice-border-color", "--border-color") ?? b, M = n.slice(0, 7);
70
- return r.editor.defineTheme(Pe, {
71
- base: lt(C) < 0.5 ? "vs-dark" : "vs",
66
+ }, x = u("--nice-bg-primary", "--bg-primary"), C = u("--nice-text-primary", "--text-primary");
67
+ if (!x || !C)
68
+ return le(c);
69
+ const p = u("--nice-bg-secondary", "--bg-secondary") ?? x, f = u("--nice-text-secondary", "--text-secondary") ?? C, i = u("--nice-color-primary", "--primary") ?? C, B = u("--nice-border-color", "--border-color") ?? f, O = i.slice(0, 7);
70
+ return o.editor.defineTheme(Pe, {
71
+ base: lt(x) < 0.5 ? "vs-dark" : "vs",
72
72
  inherit: !0,
73
73
  rules: [],
74
74
  colors: {
75
- "editor.background": C,
76
- "editor.foreground": x,
77
- "editorLineNumber.foreground": b,
78
- "editorLineNumber.activeForeground": x,
79
- "editorCursor.foreground": M,
80
- "editor.selectionBackground": `${M}40`,
81
- "editor.inactiveSelectionBackground": `${M}26`,
75
+ "editor.background": x,
76
+ "editor.foreground": C,
77
+ "editorLineNumber.foreground": f,
78
+ "editorLineNumber.activeForeground": C,
79
+ "editorCursor.foreground": O,
80
+ "editor.selectionBackground": `${O}40`,
81
+ "editor.inactiveSelectionBackground": `${O}26`,
82
82
  "editor.lineHighlightBackground": p,
83
83
  "editor.lineHighlightBorder": p,
84
84
  "editorWidget.background": p,
85
85
  "editorWidget.border": B,
86
86
  "editorSuggestWidget.background": p,
87
87
  "editorSuggestWidget.border": B,
88
- "minimap.background": C
88
+ "minimap.background": x
89
89
  }
90
90
  }), Pe;
91
91
  }
92
- function ze(r, i) {
93
- const d = new MutationObserver(i), t = {
92
+ function ze(o, c) {
93
+ const s = new MutationObserver(c), t = {
94
94
  attributes: !0,
95
95
  attributeFilter: ["data-theme", "class", "style"]
96
96
  };
97
- d.observe(document.documentElement, t);
98
- const u = r?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");
99
- u && u !== document.documentElement && d.observe(u, t);
100
- const C = window.matchMedia?.("(prefers-color-scheme: dark)");
101
- return C?.addEventListener?.("change", i), () => {
102
- d.disconnect(), C?.removeEventListener?.("change", i);
97
+ s.observe(document.documentElement, t);
98
+ const u = o?.closest?.("[data-theme], .nice-dark, .nice-light, .dark");
99
+ u && u !== document.documentElement && s.observe(u, t);
100
+ const x = window.matchMedia?.("(prefers-color-scheme: dark)");
101
+ return x?.addEventListener?.("change", c), () => {
102
+ s.disconnect(), x?.removeEventListener?.("change", c);
103
103
  };
104
104
  }
105
- function ut(r) {
106
- if (!r)
105
+ function ut(o) {
106
+ if (!o)
107
107
  return "";
108
108
  try {
109
- return JSON.stringify([r.url, r.language, r.initOptions ?? null]);
109
+ return JSON.stringify([o.url, o.language, o.initOptions ?? null]);
110
110
  } catch {
111
- return JSON.stringify([r.url, r.language]);
111
+ return JSON.stringify([o.url, o.language]);
112
112
  }
113
113
  }
114
114
  function Ve() {
115
- return ce ? Promise.resolve(ce) : re || (re = new Promise((r, i) => {
115
+ return ae ? Promise.resolve(ae) : oe || (oe = new Promise((o, c) => {
116
116
  if (window.monaco) {
117
- Ie(), ce = window.monaco, r(ce);
117
+ Ie(), ae = window.monaco, o(ae);
118
118
  return;
119
119
  }
120
- let d = !1;
120
+ let s = !1;
121
121
  const t = window.setTimeout(() => {
122
- d || (d = !0, re = null, i(new Error(`Monaco editor failed to load within ${Re}ms`)));
122
+ s || (s = !0, oe = null, c(new Error(`Monaco editor failed to load within ${Re}ms`)));
123
123
  }, Re), u = document.createElement("script");
124
124
  u.src = `${be}/loader.min.js`, u.async = !0, u.onload = () => {
125
- const C = window.require;
126
- C.config({ paths: { vs: be } }), Ie(), C(["vs/editor/editor.main"], (x) => {
127
- d || (d = !0, window.clearTimeout(t), ce = x, r(x));
125
+ const x = window.require;
126
+ x.config({ paths: { vs: be } }), Ie(), x(["vs/editor/editor.main"], (C) => {
127
+ s || (s = !0, window.clearTimeout(t), ae = C, o(C));
128
128
  });
129
129
  }, u.onerror = () => {
130
- d || (d = !0, window.clearTimeout(t), re = null, i(new Error("Failed to load Monaco Editor loader script")));
130
+ s || (s = !0, window.clearTimeout(t), oe = null, c(new Error("Failed to load Monaco Editor loader script")));
131
131
  }, document.head.appendChild(u);
132
- }), re);
132
+ }), oe);
133
133
  }
134
- function $e(r) {
135
- S(() => {
136
- const i = r.current;
137
- if (!i)
134
+ function $e(o) {
135
+ N(() => {
136
+ const c = o.current;
137
+ if (!c)
138
138
  return;
139
- const d = We(), t = (u) => {
140
- d(u) && u.stopPropagation();
139
+ const s = We(), t = (u) => {
140
+ s(u) && u.stopPropagation();
141
141
  };
142
- return i.addEventListener("keydown", t, !0), () => i.removeEventListener("keydown", t, !0);
143
- }, [r]);
142
+ return c.addEventListener("keydown", t, !0), () => c.removeEventListener("keydown", t, !0);
143
+ }, [o]);
144
144
  }
145
145
  const kt = /* @__PURE__ */ nt(
146
- function(i, d) {
146
+ function(c, s) {
147
147
  const { t } = ke();
148
- ye(ve, Ce);
148
+ ye(ve, xe);
149
149
  const {
150
150
  value: u,
151
- defaultValue: C,
152
- onChange: x,
151
+ defaultValue: x,
152
+ onChange: C,
153
153
  language: p = "plaintext",
154
- theme: b = "auto",
155
- options: n = {},
154
+ theme: f = "auto",
155
+ options: i = {},
156
156
  height: B = 400,
157
- width: M = "100%",
158
- markers: L = [],
159
- decorations: R = [],
160
- completionProvider: f,
161
- onMount: z,
162
- onCursorPositionChange: E,
163
- onSelectionChange: I,
164
- onSave: U,
165
- loading: V,
166
- disabled: $ = !1,
167
- showToolbar: Q = !1,
168
- showStatusBar: j = !1,
169
- editorSize: K = "standard",
170
- className: Z,
171
- "data-testid": q,
172
- lsp: P,
173
- extraLibs: w,
174
- tutorial: G
175
- } = i, [_, X, ee] = de({
157
+ width: O = "100%",
158
+ markers: R = [],
159
+ decorations: A = [],
160
+ completionProvider: g,
161
+ onMount: $,
162
+ onCursorPositionChange: S,
163
+ onSelectionChange: j,
164
+ onSave: H,
165
+ loading: X,
166
+ disabled: E = !1,
167
+ showToolbar: Y = !1,
168
+ showStatusBar: ee = !1,
169
+ editorSize: I = "standard",
170
+ className: J,
171
+ "data-testid": te,
172
+ lsp: W,
173
+ extraLibs: M,
174
+ tutorial: L
175
+ } = c, [w, U, Q] = de({
176
176
  value: u,
177
- defaultValue: C,
177
+ defaultValue: x,
178
178
  fallbackValue: "",
179
- onChange: x,
179
+ onChange: C,
180
180
  componentName: "NiceCodeEditor"
181
- }), Y = v(X);
182
- Y.current = X;
183
- const k = v(_);
184
- k.current = _;
185
- const l = v(!1), g = v(null);
186
- $e(g);
187
- const a = v(null), N = v(null), F = v([]), H = v(null), [T, me] = D(!0), [ne, je] = D(null), [xe, Fe] = D({
181
+ }), K = v(U);
182
+ K.current = U;
183
+ const b = v(w);
184
+ b.current = w;
185
+ const k = v(!1), l = v(null);
186
+ $e(l);
187
+ const r = v(null), _ = v(null), Z = v([]), F = v(null), [T, re] = V(!0), [ie, je] = V(null), [Ce, Fe] = V({
188
188
  lineNumber: 1,
189
189
  column: 1
190
- }), [we, He] = D(""), [pe, Be] = D(n.wordWrap === "on"), ae = Te(() => ({
190
+ }), [we, Be] = V(""), [pe, He] = V(i.wordWrap === "on"), se = Te(() => ({
191
191
  automaticLayout: !0,
192
- readOnly: $ || n.readOnly,
193
- minimap: { enabled: n.minimap ?? !0 },
194
- lineNumbers: n.lineNumbers ?? "on",
195
- wordWrap: n.wordWrap ?? "off",
196
- tabSize: n.tabSize ?? 2,
197
- insertSpaces: n.insertSpaces ?? !0,
198
- fontSize: n.fontSize ?? 14,
199
- fontFamily: n.fontFamily ?? "'Fira Code', 'Consolas', 'Monaco', monospace",
200
- fontLigatures: n.fontLigatures ?? !0,
201
- cursorStyle: n.cursorStyle ?? "line",
202
- cursorBlinking: n.cursorBlinking ?? "blink",
203
- autoClosingBrackets: n.autoClosingBrackets ?? "languageDefined",
204
- autoClosingQuotes: n.autoClosingQuotes ?? "languageDefined",
205
- formatOnPaste: n.formatOnPaste ?? !1,
206
- formatOnType: n.formatOnType ?? !1,
207
- renderWhitespace: n.renderWhitespace ?? "selection",
208
- renderControlCharacters: n.renderControlCharacters ?? !1,
209
- scrollBeyondLastLine: n.scrollBeyondLastLine ?? !0,
210
- smoothScrolling: n.smoothScrolling ?? !0,
211
- folding: n.folding ?? !0,
212
- showFoldingControls: n.showFoldingControls ?? "mouseover",
213
- "bracketPairColorization.enabled": n.bracketPairColorization ?? !0,
214
- guides: n.guides ?? {
215
- bracketPairs: !0,
192
+ readOnly: E || i.readOnly,
193
+ minimap: { enabled: i.minimap ?? !0 },
194
+ lineNumbers: i.lineNumbers ?? "on",
195
+ wordWrap: i.wordWrap ?? "off",
196
+ tabSize: i.tabSize ?? 2,
197
+ insertSpaces: i.insertSpaces ?? !0,
198
+ fontSize: i.fontSize ?? 14,
199
+ fontFamily: i.fontFamily ?? "'Fira Code', 'Consolas', 'Monaco', monospace",
200
+ fontLigatures: i.fontLigatures ?? !0,
201
+ cursorStyle: i.cursorStyle ?? "line",
202
+ cursorBlinking: i.cursorBlinking ?? "blink",
203
+ autoClosingBrackets: i.autoClosingBrackets ?? "languageDefined",
204
+ autoClosingQuotes: i.autoClosingQuotes ?? "languageDefined",
205
+ formatOnPaste: i.formatOnPaste ?? !1,
206
+ formatOnType: i.formatOnType ?? !1,
207
+ renderWhitespace: i.renderWhitespace ?? "selection",
208
+ renderControlCharacters: i.renderControlCharacters ?? !1,
209
+ scrollBeyondLastLine: i.scrollBeyondLastLine ?? !0,
210
+ smoothScrolling: i.smoothScrolling ?? !0,
211
+ folding: i.folding ?? !0,
212
+ showFoldingControls: i.showFoldingControls ?? "mouseover",
213
+ "bracketPairColorization.enabled": i.bracketPairColorization ?? !0,
214
+ // 1.4.22 ("Nie podoba mi się ta kreska jak klikam na klamrę — powinny się zaznaczać kwadratami
215
+ // podświetlenia"): no bracket-pair guide line; the matching pair gets a filled box (CSS below).
216
+ matchBrackets: "always",
217
+ guides: i.guides ?? {
218
+ bracketPairs: !1,
219
+ bracketPairsHorizontal: !1,
220
+ highlightActiveBracketPair: !1,
216
221
  indentation: !0,
217
222
  highlightActiveIndentation: !0
218
223
  },
219
- stickyScroll: { enabled: n.stickyScroll ?? !1 },
220
- quickSuggestions: n.quickSuggestions ?? !0,
221
- suggestOnTriggerCharacters: n.suggestOnTriggerCharacters ?? !0,
222
- acceptSuggestionOnEnter: n.acceptSuggestionOnEnter ?? "on",
223
- inlayHints: { enabled: n.inlayHints ? "on" : "off" }
224
- }), [n, $]), ie = v({ onCursorPositionChange: E, onSelectionChange: I, onSave: U, onMount: z });
225
- ie.current = { onCursorPositionChange: E, onSelectionChange: I, onSave: U, onMount: z };
226
- const _e = v({ language: p, theme: b, editorOptions: ae });
227
- _e.current = { language: p, theme: b, editorOptions: ae };
228
- const Ne = v(P);
229
- Ne.current = P;
230
- const Ue = ut(P), Se = v(t);
231
- Se.current = t, S(() => {
232
- if (!g.current)
224
+ stickyScroll: { enabled: i.stickyScroll ?? !1 },
225
+ quickSuggestions: i.quickSuggestions ?? !0,
226
+ suggestOnTriggerCharacters: i.suggestOnTriggerCharacters ?? !0,
227
+ acceptSuggestionOnEnter: i.acceptSuggestionOnEnter ?? "on",
228
+ inlayHints: { enabled: i.inlayHints ? "on" : "off" }
229
+ }), [i, E]), ce = v({ onCursorPositionChange: S, onSelectionChange: j, onSave: H, onMount: $ });
230
+ ce.current = { onCursorPositionChange: S, onSelectionChange: j, onSave: H, onMount: $ };
231
+ const _e = v({ language: p, theme: f, editorOptions: se });
232
+ _e.current = { language: p, theme: f, editorOptions: se };
233
+ const Ne = v(W);
234
+ Ne.current = W;
235
+ const Ue = ut(W), Se = v(t);
236
+ Se.current = t, N(() => {
237
+ if (!l.current)
233
238
  return;
234
239
  let e = !0;
235
- const s = Ne.current;
236
- return Ve().then(async (c) => {
237
- if (!e || !g.current)
240
+ const d = Ne.current;
241
+ return Ve().then(async (a) => {
242
+ if (!e || !l.current)
238
243
  return;
239
- N.current = c;
240
- const h = _e.current, y = c.editor.create(g.current, {
241
- value: k.current,
244
+ _.current = a;
245
+ const h = _e.current, y = a.editor.create(l.current, {
246
+ value: b.current,
242
247
  language: h.language,
243
- theme: se(h.theme),
248
+ theme: le(h.theme),
244
249
  ...h.editorOptions
245
250
  });
246
- if (a.current = y, me(!1), y.onDidChangeModelContent(() => {
247
- l.current || Y.current(y.getValue());
251
+ if (r.current = y, re(!1), y.onDidChangeModelContent(() => {
252
+ k.current || K.current(y.getValue());
248
253
  }), y.onDidChangeCursorPosition(
249
254
  (m) => {
250
- Fe({ lineNumber: m.position.lineNumber, column: m.position.column }), ie.current.onCursorPositionChange?.({
255
+ Fe({ lineNumber: m.position.lineNumber, column: m.position.column }), ce.current.onCursorPositionChange?.({
251
256
  lineNumber: m.position.lineNumber,
252
257
  column: m.position.column
253
258
  });
254
259
  }
255
260
  ), y.onDidChangeCursorSelection(
256
261
  (m) => {
257
- const A = m.selection, te = y.getModel()?.getValueInRange(A) ?? "";
258
- He(te), ie.current.onSelectionChange?.({
259
- startLineNumber: A.startLineNumber,
260
- startColumn: A.startColumn,
261
- endLineNumber: A.endLineNumber,
262
- endColumn: A.endColumn
262
+ const D = m.selection, G = y.getModel()?.getValueInRange(D) ?? "";
263
+ Be(G), ce.current.onSelectionChange?.({
264
+ startLineNumber: D.startLineNumber,
265
+ startColumn: D.startColumn,
266
+ endLineNumber: D.endLineNumber,
267
+ endColumn: D.endColumn
263
268
  });
264
269
  }
265
- ), y.addCommand(c.KeyMod.CtrlCmd | c.KeyCode.KeyS, () => {
266
- ie.current.onSave?.(y.getValue());
267
- }), s && typeof window < "u")
270
+ ), y.addCommand(a.KeyMod.CtrlCmd | a.KeyCode.KeyS, () => {
271
+ ce.current.onSave?.(y.getValue());
272
+ }), d && typeof window < "u")
268
273
  try {
269
- await ue(
274
+ await me(
270
275
  "https://cdn.jsdelivr.net/npm/vscode-ws-jsonrpc@1.0.2/lib/browser/index.min.js"
271
- ), await ue(
276
+ ), await me(
272
277
  "https://cdn.jsdelivr.net/npm/monaco-languageclient@0.15.0/lib/monaco-languageclient.min.js"
273
278
  );
274
- const m = window, A = m.ReconnectingWebSocket, { MonacoLanguageClient: te, CloseAction: Ye, ErrorAction: Je, createConnection: Ee } = m.monacoLanguageClient || {};
275
- if (te && Ee) {
276
- const Qe = s.url, Ze = s.language, Me = new A(Qe), Ge = new m.VSCodeWebSocketMessageReader(Me), Xe = new m.VSCodeWebSocketMessageWriter(Me), et = Ee(Ge, Xe), Le = new te({
279
+ const m = window, D = m.ReconnectingWebSocket, { MonacoLanguageClient: G, CloseAction: Ye, ErrorAction: Je, createConnection: Ee } = m.monacoLanguageClient || {};
280
+ if (G && Ee) {
281
+ const Qe = d.url, Ze = d.language, Me = new D(Qe), Ge = new m.VSCodeWebSocketMessageReader(Me), Xe = new m.VSCodeWebSocketMessageWriter(Me), et = Ee(Ge, Xe), Le = new G({
277
282
  name: "LSP Client",
278
283
  clientOptions: {
279
284
  documentSelector: [Ze],
280
- initializationOptions: s.initOptions,
285
+ initializationOptions: d.initOptions,
281
286
  errorHandler: {
282
287
  error: () => Je.Continue,
283
288
  closed: () => Ye.Restart
@@ -287,83 +292,83 @@ const kt = /* @__PURE__ */ nt(
287
292
  get: () => Promise.resolve(et)
288
293
  }
289
294
  });
290
- Le.start(), a.current.__lspClient = Le;
295
+ Le.start(), r.current.__lspClient = Le;
291
296
  }
292
297
  } catch (m) {
293
298
  console.warn("LSP bridge failed to load:", m);
294
299
  }
295
- ie.current.onMount?.(y, c);
296
- }).catch((c) => {
300
+ ce.current.onMount?.(y, a);
301
+ }).catch((a) => {
297
302
  e && (je(
298
- c.message ?? Se.current("codeEditor.failedToLoadEditor", "Failed to load editor")
299
- ), me(!1));
303
+ a.message ?? Se.current("codeEditor.failedToLoadEditor", "Failed to load editor")
304
+ ), re(!1));
300
305
  }), () => {
301
- if (e = !1, a.current?.dispose(), H.current?.dispose(), a.current && a.current.__lspClient)
306
+ if (e = !1, r.current?.dispose(), F.current?.dispose(), r.current && r.current.__lspClient)
302
307
  try {
303
- a.current.__lspClient.stop();
308
+ r.current.__lspClient.stop();
304
309
  } catch {
305
310
  }
306
311
  };
307
- }, [Ue]), S(() => {
308
- const e = a.current;
309
- if (!ee || !e || _ === e.getValue())
312
+ }, [Ue]), N(() => {
313
+ const e = r.current;
314
+ if (!Q || !e || w === e.getValue())
310
315
  return;
311
- const s = e.getPosition();
312
- l.current = !0;
316
+ const d = e.getPosition();
317
+ k.current = !0;
313
318
  try {
314
- e.setValue(_);
319
+ e.setValue(w);
315
320
  } finally {
316
- l.current = !1;
321
+ k.current = !1;
317
322
  }
318
- s && e.setPosition(s);
319
- }, [_, ee]), S(() => {
320
- const e = a.current, s = N.current;
321
- if (e && s) {
322
- const c = e.getModel();
323
- c && s.editor.setModelLanguage(c, p);
323
+ d && e.setPosition(d);
324
+ }, [w, Q]), N(() => {
325
+ const e = r.current, d = _.current;
326
+ if (e && d) {
327
+ const a = e.getModel();
328
+ a && d.editor.setModelLanguage(a, p);
324
329
  }
325
- }, [p]), S(() => {
326
- const e = N.current;
327
- if (!e || T || !w || w.length === 0 || p !== "javascript" && p !== "typescript")
330
+ }, [p]), N(() => {
331
+ const e = _.current;
332
+ if (!e || T || !M || M.length === 0 || p !== "javascript" && p !== "typescript")
328
333
  return;
329
- const s = e.languages?.typescript;
330
- if (!s)
334
+ const d = e.languages?.typescript;
335
+ if (!d)
331
336
  return;
332
- const c = [];
337
+ const a = [];
333
338
  try {
334
- w.forEach((h, y) => {
335
- const m = h.filePath ?? `inmemory://model/nice-extralib-${y}.d.ts`, A = s.typescriptDefaults?.addExtraLib(h.content, m);
336
- A && c.push(A);
337
- const te = s.javascriptDefaults?.addExtraLib(h.content, m);
338
- te && c.push(te);
339
+ M.forEach((h, y) => {
340
+ const m = h.filePath ?? `inmemory://model/nice-extralib-${y}.d.ts`, D = d.typescriptDefaults?.addExtraLib(h.content, m);
341
+ D && a.push(D);
342
+ const G = d.javascriptDefaults?.addExtraLib(h.content, m);
343
+ G && a.push(G);
339
344
  });
340
345
  } catch (h) {
341
346
  console.warn("Failed to register extraLibs:", h);
342
347
  }
343
348
  return () => {
344
- c.forEach((h) => {
349
+ a.forEach((h) => {
345
350
  try {
346
351
  h.dispose();
347
352
  } catch {
348
353
  }
349
354
  });
350
355
  };
351
- }, [w, p, T]), S(() => {
352
- const e = N.current;
353
- if (e && (e.editor.setTheme(le(e, b, g.current)), !(b !== "auto" || typeof document > "u")))
354
- return ze(g.current, () => {
355
- const s = N.current;
356
- s?.editor.setTheme(le(s, "auto", g.current));
356
+ }, [M, p, T]), N(() => {
357
+ const e = _.current;
358
+ if (e && (e.editor.setTheme(ue(e, f, l.current)), !(f !== "auto" || typeof document > "u")))
359
+ return ze(l.current, () => {
360
+ const d = _.current;
361
+ d?.editor.setTheme(ue(d, "auto", l.current));
357
362
  });
358
- }, [b, T]), S(() => {
359
- const e = a.current;
360
- e && e.updateOptions(ae);
361
- }, [ae]), S(() => {
362
- const e = a.current, s = N.current;
363
- if (e && s) {
364
- const c = e.getModel();
365
- if (c) {
366
- const h = L.map((y) => ({
363
+ }, [f, T]), N(() => {
364
+ const e = r.current;
365
+ e && e.updateOptions(se);
366
+ }, [se]), N(() => {
367
+ const e = r.current, d = _.current;
368
+ if (e && d) {
369
+ const a = e.getModel();
370
+ if (a) {
371
+ const h = R.map((y) => ({
367
372
  startLineNumber: y.startLineNumber,
368
373
  startColumn: y.startColumn,
369
374
  endLineNumber: y.endLineNumber,
@@ -371,37 +376,37 @@ const kt = /* @__PURE__ */ nt(
371
376
  message: y.message,
372
377
  severity: y.severity
373
378
  }));
374
- s.editor.setModelMarkers(c, "owner", h);
379
+ d.editor.setModelMarkers(a, "owner", h);
375
380
  }
376
381
  }
377
- }, [L]), S(() => {
378
- const e = a.current;
379
- if (e && R.length > 0) {
380
- const s = R.map((c) => ({
382
+ }, [R]), N(() => {
383
+ const e = r.current;
384
+ if (e && A.length > 0) {
385
+ const d = A.map((a) => ({
381
386
  range: {
382
- startLineNumber: c.range.startLineNumber,
383
- startColumn: c.range.startColumn,
384
- endLineNumber: c.range.endLineNumber,
385
- endColumn: c.range.endColumn
387
+ startLineNumber: a.range.startLineNumber,
388
+ startColumn: a.range.startColumn,
389
+ endLineNumber: a.range.endLineNumber,
390
+ endColumn: a.range.endColumn
386
391
  },
387
392
  options: {
388
- className: c.className,
389
- glyphMarginClassName: c.glyphMarginClassName,
390
- hoverMessage: c.hoverMessage ? { value: c.hoverMessage } : void 0,
391
- isWholeLine: c.isWholeLine
393
+ className: a.className,
394
+ glyphMarginClassName: a.glyphMarginClassName,
395
+ hoverMessage: a.hoverMessage ? { value: a.hoverMessage } : void 0,
396
+ isWholeLine: a.isWholeLine
392
397
  }
393
398
  }));
394
- F.current = e.deltaDecorations(
395
- F.current,
396
- s
399
+ Z.current = e.deltaDecorations(
400
+ Z.current,
401
+ d
397
402
  );
398
403
  }
399
- }, [R]), S(() => {
400
- const e = N.current;
401
- if (!e || !f)
404
+ }, [A]), N(() => {
405
+ const e = _.current;
406
+ if (!e || !g)
402
407
  return;
403
- H.current?.dispose();
404
- const s = {
408
+ F.current?.dispose();
409
+ const d = {
405
410
  text: 0,
406
411
  method: 1,
407
412
  function: 2,
@@ -419,11 +424,11 @@ const kt = /* @__PURE__ */ nt(
419
424
  reference: 17,
420
425
  folder: 18
421
426
  };
422
- return H.current = e.languages.registerCompletionItemProvider(p, {
423
- provideCompletionItems: async (c, h) => ({
424
- suggestions: (await f(c, h)).map((m) => ({
427
+ return F.current = e.languages.registerCompletionItemProvider(p, {
428
+ provideCompletionItems: async (a, h) => ({
429
+ suggestions: (await g(a, h)).map((m) => ({
425
430
  label: m.label,
426
- kind: s[m.kind] ?? 0,
431
+ kind: d[m.kind] ?? 0,
427
432
  insertText: m.insertText,
428
433
  insertTextRules: m.insertTextRules === "insertAsSnippet" ? 4 : void 0,
429
434
  documentation: m.documentation,
@@ -437,54 +442,54 @@ const kt = /* @__PURE__ */ nt(
437
442
  }))
438
443
  })
439
444
  }), () => {
440
- H.current?.dispose();
445
+ F.current?.dispose();
441
446
  };
442
- }, [p, f]), it(
443
- d,
447
+ }, [p, g]), it(
448
+ s,
444
449
  () => ({
445
- getEditor: () => a.current,
446
- getMonaco: () => N.current,
447
- focus: () => a.current?.focus(),
448
- getValue: () => a.current?.getValue() ?? "",
449
- setValue: (e) => a.current?.setValue(e),
450
+ getEditor: () => r.current,
451
+ getMonaco: () => _.current,
452
+ focus: () => r.current?.focus(),
453
+ getValue: () => r.current?.getValue() ?? "",
454
+ setValue: (e) => r.current?.setValue(e),
450
455
  getSelection: () => {
451
- const e = a.current;
456
+ const e = r.current;
452
457
  if (!e)
453
458
  return "";
454
- const s = e.getSelection();
455
- return s ? e.getModel()?.getValueInRange(s) ?? "" : "";
459
+ const d = e.getSelection();
460
+ return d ? e.getModel()?.getValueInRange(d) ?? "" : "";
456
461
  },
457
462
  insertText: (e) => {
458
- const s = a.current;
459
- if (!s)
463
+ const d = r.current;
464
+ if (!d)
460
465
  return;
461
- const c = s.getSelection();
462
- c && s.executeEdits("", [{ range: c, text: e }]);
466
+ const a = d.getSelection();
467
+ a && d.executeEdits("", [{ range: a, text: e }]);
463
468
  },
464
469
  formatDocument: () => {
465
- a.current?.getAction("editor.action.formatDocument")?.run();
470
+ r.current?.getAction("editor.action.formatDocument")?.run();
466
471
  },
467
- goToLine: (e, s = 1) => {
468
- const c = a.current;
469
- c && (c.setPosition({ lineNumber: e, column: s }), c.revealLineInCenter(e), c.focus());
472
+ goToLine: (e, d = 1) => {
473
+ const a = r.current;
474
+ a && (a.setPosition({ lineNumber: e, column: d }), a.revealLineInCenter(e), a.focus());
470
475
  },
471
476
  findReplace: () => {
472
- a.current?.getAction("editor.action.startFindReplaceAction")?.run();
477
+ r.current?.getAction("editor.action.startFindReplaceAction")?.run();
473
478
  },
474
479
  undo: () => {
475
- a.current?.trigger("keyboard", "undo", null);
480
+ r.current?.trigger("keyboard", "undo", null);
476
481
  },
477
482
  redo: () => {
478
- a.current?.trigger("keyboard", "redo", null);
483
+ r.current?.trigger("keyboard", "redo", null);
479
484
  },
480
485
  getCursorPosition: () => {
481
- const e = a.current?.getPosition();
486
+ const e = r.current?.getPosition();
482
487
  return { lineNumber: e?.lineNumber ?? 1, column: e?.column ?? 1 };
483
488
  },
484
489
  setMarkers: (e) => {
485
- const s = a.current, c = N.current;
486
- if (s && c) {
487
- const h = s.getModel();
490
+ const d = r.current, a = _.current;
491
+ if (d && a) {
492
+ const h = d.getModel();
488
493
  if (h) {
489
494
  const y = e.map((m) => ({
490
495
  startLineNumber: m.startLineNumber,
@@ -494,44 +499,44 @@ const kt = /* @__PURE__ */ nt(
494
499
  message: m.message,
495
500
  severity: m.severity
496
501
  }));
497
- c.editor.setModelMarkers(h, "owner", y);
502
+ a.editor.setModelMarkers(h, "owner", y);
498
503
  }
499
504
  }
500
505
  }
501
506
  }),
502
507
  []
503
508
  );
504
- const J = Te(
509
+ const q = Te(
505
510
  () => ({
506
- format: () => a.current?.getAction("editor.action.formatDocument")?.run(),
507
- undo: () => a.current?.trigger("keyboard", "undo", null),
508
- redo: () => a.current?.trigger("keyboard", "redo", null),
509
- find: () => a.current?.getAction("editor.action.startFindReplaceAction")?.run(),
511
+ format: () => r.current?.getAction("editor.action.formatDocument")?.run(),
512
+ undo: () => r.current?.trigger("keyboard", "undo", null),
513
+ redo: () => r.current?.trigger("keyboard", "redo", null),
514
+ find: () => r.current?.getAction("editor.action.startFindReplaceAction")?.run(),
510
515
  toggleWordWrap: () => {
511
516
  const e = !pe;
512
- Be(e), a.current?.updateOptions({ wordWrap: e ? "on" : "off" });
517
+ He(e), r.current?.updateOptions({ wordWrap: e ? "on" : "off" });
513
518
  },
514
519
  toggleMinimap: () => {
515
- const e = a.current?.getOption?.(
516
- N.current?.editor?.EditorOption?.minimap
520
+ const e = r.current?.getOption?.(
521
+ _.current?.editor?.EditorOption?.minimap
517
522
  );
518
- a.current?.updateOptions({ minimap: { enabled: !e?.enabled } });
523
+ r.current?.updateOptions({ minimap: { enabled: !e?.enabled } });
519
524
  },
520
- foldAll: () => a.current?.getAction("editor.foldAll")?.run(),
521
- unfoldAll: () => a.current?.getAction("editor.unfoldAll")?.run()
525
+ foldAll: () => r.current?.getAction("editor.foldAll")?.run(),
526
+ unfoldAll: () => r.current?.getAction("editor.unfoldAll")?.run()
522
527
  }),
523
528
  [pe]
524
- ), Ke = _.split(`
525
- `).length, qe = _.length;
526
- return /* @__PURE__ */ W(
529
+ ), Ke = w.split(`
530
+ `).length, qe = w.length;
531
+ return /* @__PURE__ */ z(
527
532
  "div",
528
533
  {
529
- className: `nice-code-editor-wrap nice-editor--${K} ${Z ?? ""}`,
530
- style: { height: B, width: M, display: "flex", flexDirection: "column", position: "relative" },
531
- "data-testid": q,
534
+ className: `nice-code-editor-wrap nice-editor--${I} ${J ?? ""}`,
535
+ style: { height: B, width: O, display: "flex", flexDirection: "column", position: "relative" },
536
+ "data-testid": te,
532
537
  children: [
533
- /* @__PURE__ */ o("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ o(tt, { steps: rt(G, at) }) }),
534
- ne && /* @__PURE__ */ W(
538
+ /* @__PURE__ */ n("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 20 }, children: /* @__PURE__ */ n(tt, { steps: rt(L, at) }) }),
539
+ ie && /* @__PURE__ */ z(
535
540
  "div",
536
541
  {
537
542
  className: "nice-code-editor__error",
@@ -542,24 +547,24 @@ const kt = /* @__PURE__ */ nt(
542
547
  background: "var(--nice-bg-primary, #fff)"
543
548
  },
544
549
  children: [
545
- /* @__PURE__ */ W("span", { children: [
546
- /* @__PURE__ */ o(O, { name: "warning", size: 16 }),
550
+ /* @__PURE__ */ z("span", { children: [
551
+ /* @__PURE__ */ n(P, { name: "warning", size: 16 }),
547
552
  " ",
548
- ne
553
+ ie
549
554
  ] }),
550
- /* @__PURE__ */ o(
555
+ /* @__PURE__ */ n(
551
556
  "textarea",
552
557
  {
553
- value: _,
554
- onChange: (e) => X(e.target.value),
555
- readOnly: $ || n.readOnly,
558
+ value: w,
559
+ onChange: (e) => U(e.target.value),
560
+ readOnly: E || i.readOnly,
556
561
  style: { width: "100%", height: "100%", fontFamily: "monospace" }
557
562
  }
558
563
  )
559
564
  ]
560
565
  }
561
566
  ),
562
- T && !ne && /* @__PURE__ */ o(
567
+ T && !ie && /* @__PURE__ */ n(
563
568
  "div",
564
569
  {
565
570
  className: "nice-code-editor__loader-overlay",
@@ -572,108 +577,108 @@ const kt = /* @__PURE__ */ nt(
572
577
  justifyContent: "center",
573
578
  background: "var(--nice-bg-primary, #fff)"
574
579
  },
575
- children: V ?? /* @__PURE__ */ o("div", { className: "nice-code-editor__loader", children: t("codeEditor.loadingEditor", "Loading editor...") })
580
+ children: X ?? /* @__PURE__ */ n("div", { className: "nice-code-editor__loader", children: t("codeEditor.loadingEditor", "Loading editor...") })
576
581
  }
577
582
  ),
578
- Q && /* @__PURE__ */ W("div", { className: "nice-code-editor__toolbar", children: [
579
- /* @__PURE__ */ o(
583
+ Y && /* @__PURE__ */ z("div", { className: "nice-code-editor__toolbar", children: [
584
+ /* @__PURE__ */ n(
580
585
  "button",
581
586
  {
582
587
  className: "nice-code-editor__toolbar-btn",
583
- onClick: J.undo,
588
+ onClick: q.undo,
584
589
  title: t("codeEditor.undoCtrlZ", "Undo (Ctrl+Z)"),
585
590
  "aria-label": t("codeEditor.undo", "Undo"),
586
- children: /* @__PURE__ */ o(O, { name: "reply", size: 16 })
591
+ children: /* @__PURE__ */ n(P, { name: "reply", size: 16 })
587
592
  }
588
593
  ),
589
- /* @__PURE__ */ o(
594
+ /* @__PURE__ */ n(
590
595
  "button",
591
596
  {
592
597
  className: "nice-code-editor__toolbar-btn",
593
- onClick: J.redo,
598
+ onClick: q.redo,
594
599
  title: t("codeEditor.redoCtrlY", "Redo (Ctrl+Y)"),
595
600
  "aria-label": t("codeEditor.redo", "Redo"),
596
- children: /* @__PURE__ */ o(O, { name: "forward", size: 16 })
601
+ children: /* @__PURE__ */ n(P, { name: "forward", size: 16 })
597
602
  }
598
603
  ),
599
- /* @__PURE__ */ o("span", { className: "nice-code-editor__toolbar-sep" }),
600
- /* @__PURE__ */ o(
604
+ /* @__PURE__ */ n("span", { className: "nice-code-editor__toolbar-sep" }),
605
+ /* @__PURE__ */ n(
601
606
  "button",
602
607
  {
603
608
  className: "nice-code-editor__toolbar-btn",
604
- onClick: J.format,
609
+ onClick: q.format,
605
610
  title: t("codeEditor.formatShiftAltF", "Format (Shift+Alt+F)"),
606
611
  "aria-label": t("codeEditor.format", "Format"),
607
- children: /* @__PURE__ */ o(O, { name: "type", size: 16 })
612
+ children: /* @__PURE__ */ n(P, { name: "type", size: 16 })
608
613
  }
609
614
  ),
610
- /* @__PURE__ */ o(
615
+ /* @__PURE__ */ n(
611
616
  "button",
612
617
  {
613
618
  className: "nice-code-editor__toolbar-btn",
614
- onClick: J.find,
619
+ onClick: q.find,
615
620
  title: t("codeEditor.findReplaceCtrlH", "Find & Replace (Ctrl+H)"),
616
621
  "aria-label": t("codeEditor.findReplace", "Find & Replace"),
617
- children: /* @__PURE__ */ o(O, { name: "search", size: 16 })
622
+ children: /* @__PURE__ */ n(P, { name: "search", size: 16 })
618
623
  }
619
624
  ),
620
- /* @__PURE__ */ o("span", { className: "nice-code-editor__toolbar-sep" }),
621
- /* @__PURE__ */ o(
625
+ /* @__PURE__ */ n("span", { className: "nice-code-editor__toolbar-sep" }),
626
+ /* @__PURE__ */ n(
622
627
  "button",
623
628
  {
624
629
  className: `nice-code-editor__toolbar-btn${pe ? " nice-code-editor__toolbar-btn--active" : ""}`,
625
- onClick: J.toggleWordWrap,
630
+ onClick: q.toggleWordWrap,
626
631
  title: t("codeEditor.toggleWordWrap", "Toggle Word Wrap"),
627
632
  "aria-label": t("codeEditor.toggleWordWrap", "Toggle Word Wrap"),
628
- children: /* @__PURE__ */ o(O, { name: "align-left", size: 16 })
633
+ children: /* @__PURE__ */ n(P, { name: "align-left", size: 16 })
629
634
  }
630
635
  ),
631
- /* @__PURE__ */ o(
636
+ /* @__PURE__ */ n(
632
637
  "button",
633
638
  {
634
639
  className: "nice-code-editor__toolbar-btn",
635
- onClick: J.toggleMinimap,
640
+ onClick: q.toggleMinimap,
636
641
  title: t("codeEditor.toggleMinimap", "Toggle Minimap"),
637
642
  "aria-label": t("codeEditor.toggleMinimap", "Toggle Minimap"),
638
- children: /* @__PURE__ */ o(O, { name: "columns", size: 16 })
643
+ children: /* @__PURE__ */ n(P, { name: "columns", size: 16 })
639
644
  }
640
645
  ),
641
- /* @__PURE__ */ o("span", { className: "nice-code-editor__toolbar-sep" }),
642
- /* @__PURE__ */ o(
646
+ /* @__PURE__ */ n("span", { className: "nice-code-editor__toolbar-sep" }),
647
+ /* @__PURE__ */ n(
643
648
  "button",
644
649
  {
645
650
  className: "nice-code-editor__toolbar-btn",
646
- onClick: J.foldAll,
651
+ onClick: q.foldAll,
647
652
  title: t("codeEditor.foldAll", "Fold All"),
648
653
  "aria-label": t("codeEditor.foldAll", "Fold All"),
649
- children: /* @__PURE__ */ o(O, { name: "collapse", size: 16 })
654
+ children: /* @__PURE__ */ n(P, { name: "collapse", size: 16 })
650
655
  }
651
656
  ),
652
- /* @__PURE__ */ o(
657
+ /* @__PURE__ */ n(
653
658
  "button",
654
659
  {
655
660
  className: "nice-code-editor__toolbar-btn",
656
- onClick: J.unfoldAll,
661
+ onClick: q.unfoldAll,
657
662
  title: t("codeEditor.unfoldAll", "Unfold All"),
658
663
  "aria-label": t("codeEditor.unfoldAll", "Unfold All"),
659
- children: /* @__PURE__ */ o(O, { name: "expand", size: 16 })
664
+ children: /* @__PURE__ */ n(P, { name: "expand", size: 16 })
660
665
  }
661
666
  )
662
667
  ] }),
663
- /* @__PURE__ */ o("div", { ref: g, className: "nice-code-editor", style: { flex: 1, minHeight: 0 } }),
664
- j && /* @__PURE__ */ W("div", { className: "nice-code-editor__statusbar", children: [
665
- /* @__PURE__ */ o("span", { children: t("codeEditor.lnCol", "Ln {lineNumber}, Col {column}").replace("{lineNumber}", String(xe.lineNumber)).replace("{column}", String(xe.column)) }),
666
- we.length > 0 && /* @__PURE__ */ o("span", { children: t("codeEditor.selected", "({selectionText} selected)").replace(
668
+ /* @__PURE__ */ n("div", { ref: l, className: "nice-code-editor", style: { flex: 1, minHeight: 0 } }),
669
+ ee && /* @__PURE__ */ z("div", { className: "nice-code-editor__statusbar", children: [
670
+ /* @__PURE__ */ n("span", { children: t("codeEditor.lnCol", "Ln {lineNumber}, Col {column}").replace("{lineNumber}", String(Ce.lineNumber)).replace("{column}", String(Ce.column)) }),
671
+ we.length > 0 && /* @__PURE__ */ n("span", { children: t("codeEditor.selected", "({selectionText} selected)").replace(
667
672
  "{selectionText}",
668
673
  String(we.length)
669
674
  ) }),
670
- /* @__PURE__ */ o("span", { className: "nice-code-editor__statusbar-spacer" }),
671
- /* @__PURE__ */ o("span", { children: t("codeEditor.linesChars", "{lineCount} lines · {charCount} chars").replace("{lineCount}", String(Ke)).replace("{charCount}", String(qe)) }),
672
- /* @__PURE__ */ o("span", { className: "nice-code-editor__statusbar-lang", children: p }),
673
- L.length > 0 && /* @__PURE__ */ W("span", { className: "nice-code-editor__statusbar-markers", children: [
674
- /* @__PURE__ */ o(O, { name: "warning", size: 14 }),
675
+ /* @__PURE__ */ n("span", { className: "nice-code-editor__statusbar-spacer" }),
676
+ /* @__PURE__ */ n("span", { children: t("codeEditor.linesChars", "{lineCount} lines · {charCount} chars").replace("{lineCount}", String(Ke)).replace("{charCount}", String(qe)) }),
677
+ /* @__PURE__ */ n("span", { className: "nice-code-editor__statusbar-lang", children: p }),
678
+ R.length > 0 && /* @__PURE__ */ z("span", { className: "nice-code-editor__statusbar-markers", children: [
679
+ /* @__PURE__ */ n(P, { name: "warning", size: 14 }),
675
680
  " ",
676
- L.length
681
+ R.length
677
682
  ] })
678
683
  ] })
679
684
  ]
@@ -681,112 +686,120 @@ const kt = /* @__PURE__ */ nt(
681
686
  );
682
687
  }
683
688
  );
684
- function yt(r) {
685
- const { t: i } = ke();
686
- ye(ve, Ce);
689
+ function yt(o) {
690
+ const { t: c } = ke();
691
+ ye(ve, xe);
687
692
  const {
688
- original: d,
693
+ original: s,
689
694
  defaultOriginal: t,
690
695
  modified: u,
691
- defaultModified: C,
692
- language: x = "plaintext",
696
+ defaultModified: x,
697
+ language: C = "plaintext",
693
698
  theme: p = "auto",
694
- height: b = 400,
695
- width: n = "100%",
699
+ height: f = 400,
700
+ width: i = "100%",
696
701
  inline: B = !1,
697
- renderSideBySide: M = !0,
698
- originalEditable: L = !1,
699
- modifiedEditable: R = !1,
700
- onOriginalChange: f,
701
- onModifiedChange: z,
702
- loading: E,
703
- className: I,
704
- "data-testid": U
705
- } = r, [V, $, Q] = de({
706
- value: d,
702
+ renderSideBySide: O = !0,
703
+ originalEditable: R = !1,
704
+ modifiedEditable: A = !1,
705
+ onOriginalChange: g,
706
+ onModifiedChange: $,
707
+ loading: S,
708
+ options: j,
709
+ className: H,
710
+ "data-testid": X
711
+ } = o, [E, Y, ee] = de({
712
+ value: s,
707
713
  defaultValue: t,
708
714
  fallbackValue: "",
709
- onChange: f,
715
+ onChange: g,
710
716
  componentName: "NiceCodeDiffEditor.original"
711
- }), [j, K, Z] = de({
717
+ }), [I, J, te] = de({
712
718
  value: u,
713
- defaultValue: C,
719
+ defaultValue: x,
714
720
  fallbackValue: "",
715
- onChange: z,
721
+ onChange: $,
716
722
  componentName: "NiceCodeDiffEditor.modified"
717
- }), q = v({ currentOriginal: V, currentModified: j, setOriginal: $, setModified: K });
718
- q.current = { currentOriginal: V, currentModified: j, setOriginal: $, setModified: K };
719
- const P = v(!1), w = v(null);
720
- $e(w);
721
- const G = v(null), _ = v(null), [X, ee] = D(!0), [Y, k] = D(null);
722
- return S(() => {
723
- if (!w.current)
723
+ }), W = v({ currentOriginal: E, currentModified: I, setOriginal: Y, setModified: J });
724
+ W.current = { currentOriginal: E, currentModified: I, setOriginal: Y, setModified: J };
725
+ const M = v(!1), L = v(null);
726
+ $e(L);
727
+ const w = v(null), U = v(null), [Q, K] = V(!0), [b, k] = V(null);
728
+ return N(() => {
729
+ if (!L.current)
724
730
  return;
725
731
  let l = !0;
726
- return Ve().then((g) => {
727
- if (!l || !w.current)
732
+ return Ve().then((r) => {
733
+ if (!l || !L.current)
728
734
  return;
729
- _.current = g;
730
- const { currentOriginal: a, currentModified: N } = q.current, F = g.editor.createModel(a, x), H = g.editor.createModel(N, x), T = g.editor.createDiffEditor(w.current, {
735
+ U.current = r;
736
+ const { currentOriginal: _, currentModified: Z } = W.current, F = r.editor.createModel(_, C), T = r.editor.createModel(Z, C), re = r.editor.createDiffEditor(L.current, {
731
737
  automaticLayout: !0,
732
- theme: se(p),
733
- renderSideBySide: !B && M,
734
- originalEditable: L,
735
- readOnly: !R
738
+ theme: le(p),
739
+ renderSideBySide: !B && O,
740
+ originalEditable: R,
741
+ readOnly: !A,
742
+ scrollBeyondLastLine: !1,
743
+ lineNumbersMinChars: 3,
744
+ glyphMargin: !1,
745
+ folding: !1,
746
+ lineDecorationsWidth: 14,
747
+ minimap: { enabled: !1 },
748
+ ...j
736
749
  });
737
- T.setModel({
750
+ re.setModel({
738
751
  original: F,
739
- modified: H
740
- }), G.current = T, ee(!1), L && F.onDidChangeContent(() => {
741
- P.current || q.current.setOriginal(F.getValue());
742
- }), R && H.onDidChangeContent(() => {
743
- P.current || q.current.setModified(H.getValue());
752
+ modified: T
753
+ }), w.current = re, K(!1), R && F.onDidChangeContent(() => {
754
+ M.current || W.current.setOriginal(F.getValue());
755
+ }), A && T.onDidChangeContent(() => {
756
+ M.current || W.current.setModified(T.getValue());
744
757
  });
745
- }).catch((g) => {
758
+ }).catch((r) => {
746
759
  l && (k(
747
- g.message ?? i("codeEditor.failedToLoadDiffEditor", "Failed to load diff editor")
748
- ), ee(!1));
760
+ r.message ?? c("codeEditor.failedToLoadDiffEditor", "Failed to load diff editor")
761
+ ), K(!1));
749
762
  }), () => {
750
- l = !1, G.current?.dispose();
763
+ l = !1, w.current?.dispose();
751
764
  };
752
- }, [i]), S(() => {
753
- const l = G.current?.getModel();
765
+ }, [c]), N(() => {
766
+ const l = w.current?.getModel();
754
767
  if (l) {
755
- P.current = !0;
768
+ M.current = !0;
756
769
  try {
757
- Q && l.original.getValue() !== V && l.original.setValue(V), Z && l.modified.getValue() !== j && l.modified.setValue(j);
770
+ ee && l.original.getValue() !== E && l.original.setValue(E), te && l.modified.getValue() !== I && l.modified.setValue(I);
758
771
  } finally {
759
- P.current = !1;
772
+ M.current = !1;
760
773
  }
761
774
  }
762
- }, [V, j, Q, Z]), S(() => {
763
- const l = _.current;
764
- if (l && (l.editor.setTheme(le(l, p, w.current)), !(p !== "auto" || typeof document > "u")))
765
- return ze(w.current, () => {
766
- const g = _.current;
767
- g?.editor.setTheme(le(g, "auto", w.current));
775
+ }, [E, I, ee, te]), N(() => {
776
+ const l = U.current;
777
+ if (l && (l.editor.setTheme(ue(l, p, L.current)), !(p !== "auto" || typeof document > "u")))
778
+ return ze(L.current, () => {
779
+ const r = U.current;
780
+ r?.editor.setTheme(ue(r, "auto", L.current));
768
781
  });
769
- }, [p, X]), Y ? /* @__PURE__ */ o(
782
+ }, [p, Q]), b ? /* @__PURE__ */ n(
770
783
  "div",
771
784
  {
772
- className: `nice-code-diff-editor nice-code-diff-editor--error ${I ?? ""}`,
773
- style: { height: b, width: n },
774
- "data-testid": U,
775
- children: /* @__PURE__ */ o("div", { className: "nice-code-editor__error", children: /* @__PURE__ */ W("span", { children: [
776
- /* @__PURE__ */ o(O, { name: "warning", size: 16 }),
785
+ className: `nice-code-diff-editor nice-code-diff-editor--error ${H ?? ""}`,
786
+ style: { height: f, width: i },
787
+ "data-testid": X,
788
+ children: /* @__PURE__ */ n("div", { className: "nice-code-editor__error", children: /* @__PURE__ */ z("span", { children: [
789
+ /* @__PURE__ */ n(P, { name: "warning", size: 16 }),
777
790
  " ",
778
- Y
791
+ b
779
792
  ] }) })
780
793
  }
781
- ) : /* @__PURE__ */ W(
794
+ ) : /* @__PURE__ */ z(
782
795
  "div",
783
796
  {
784
- className: `nice-code-diff-editor ${I ?? ""}`,
785
- style: { height: b, width: n, position: "relative" },
786
- "data-testid": U,
797
+ className: `nice-code-diff-editor ${H ?? ""}`,
798
+ style: { height: f, width: i, position: "relative" },
799
+ "data-testid": X,
787
800
  children: [
788
- /* @__PURE__ */ o("div", { ref: w, style: { position: "absolute", inset: 0 } }),
789
- X && /* @__PURE__ */ o(
801
+ /* @__PURE__ */ n("div", { ref: L, style: { position: "absolute", inset: 0 } }),
802
+ Q && /* @__PURE__ */ n(
790
803
  "div",
791
804
  {
792
805
  style: {
@@ -798,7 +811,7 @@ function yt(r) {
798
811
  background: "var(--nice-bg-primary, #fff)",
799
812
  zIndex: 2
800
813
  },
801
- children: E ?? /* @__PURE__ */ o("div", { className: "nice-code-editor__loader", children: i("codeEditor.loadingDiffEditor", "Loading diff editor...") })
814
+ children: S ?? /* @__PURE__ */ n("div", { className: "nice-code-editor__loader", children: c("codeEditor.loadingDiffEditor", "Loading diff editor...") })
802
815
  }
803
816
  )
804
817
  ]
@@ -832,136 +845,136 @@ const he = {
832
845
  powershell: "powershell",
833
846
  plaintext: "plain"
834
847
  };
835
- function ue(r) {
836
- return new Promise((i, d) => {
837
- if (document.querySelector(`script[data-prism-src="${r}"]`)) {
838
- i();
848
+ function me(o) {
849
+ return new Promise((c, s) => {
850
+ if (document.querySelector(`script[data-prism-src="${o}"]`)) {
851
+ c();
839
852
  return;
840
853
  }
841
854
  const t = document.createElement("script");
842
- t.src = r, t.async = !0, t.dataset.prismSrc = r, t.onload = () => i(), t.onerror = () => d(new Error(`Failed to load ${r}`)), document.head.appendChild(t);
855
+ t.src = o, t.async = !0, t.dataset.prismSrc = o, t.onload = () => c(), t.onerror = () => s(new Error(`Failed to load ${o}`)), document.head.appendChild(t);
843
856
  });
844
857
  }
845
- function pt(r) {
858
+ function pt(o) {
846
859
  if (typeof window > "u")
847
860
  return Promise.resolve(null);
848
- const i = window, d = he[r] ?? "plain", t = async () => {
849
- if (d !== "plain" && !i.Prism?.languages?.[d])
861
+ const c = window, s = he[o] ?? "plain", t = async () => {
862
+ if (s !== "plain" && !c.Prism?.languages?.[s])
850
863
  try {
851
- await ue(`${Ae}/components/prism-${d}.min.js`);
864
+ await me(`${Ae}/components/prism-${s}.min.js`);
852
865
  } catch {
853
866
  }
854
867
  };
855
- return i.Prism?.languages ? t().then(() => i.Prism) : (ge || (ge = (async () => (window.Prism = { manual: !0 }, await ue(`${Ae}/prism.min.js`), window.Prism))()), ge.then(async () => (await t(), window.Prism)));
868
+ return c.Prism?.languages ? t().then(() => c.Prism) : (ge || (ge = (async () => (window.Prism = { manual: !0 }, await me(`${Ae}/prism.min.js`), window.Prism))()), ge.then(async () => (await t(), window.Prism)));
856
869
  }
857
- function fe(r) {
858
- return r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
870
+ function fe(o) {
871
+ return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
859
872
  }
860
- function vt(r) {
861
- ye(ve, Ce);
873
+ function vt(o) {
874
+ ye(ve, xe);
862
875
  const {
863
- value: i,
864
- defaultValue: d,
876
+ value: c,
877
+ defaultValue: s,
865
878
  onChange: t,
866
879
  language: u = "plaintext",
867
- height: C = 300,
868
- width: x = "100%",
880
+ height: x = 300,
881
+ width: C = "100%",
869
882
  readOnly: p = !1,
870
- tabSize: b = 2,
871
- lineNumbers: n = !0,
883
+ tabSize: f = 2,
884
+ lineNumbers: i = !0,
872
885
  placeholder: B,
873
- theme: M = "auto",
874
- className: L,
875
- "data-testid": R
876
- } = r, [f, z] = de({
877
- value: i,
878
- defaultValue: d,
886
+ theme: O = "auto",
887
+ className: R,
888
+ "data-testid": A
889
+ } = o, [g, $] = de({
890
+ value: c,
891
+ defaultValue: s,
879
892
  fallbackValue: "",
880
893
  onChange: t,
881
894
  componentName: "NiceSimpleCodeEditor"
882
- }), E = v(null), I = v(null), U = v(null), { t: V } = ke(), $ = ct(), [Q] = D(We), [j, K] = D(() => fe(f)), Z = v(null), [q] = D(() => ({
895
+ }), S = v(null), j = v(null), H = v(null), { t: X } = ke(), E = ct(), [Y] = V(We), [ee, I] = V(() => fe(g)), J = v(null), [te] = V(() => ({
883
896
  get current() {
884
- return Z.current?.parentElement ?? null;
897
+ return J.current?.parentElement ?? null;
885
898
  }
886
- })), P = ot(q), w = M === "auto" ? P ? "dark" : "light" : M;
887
- S(() => {
888
- let k = !0;
889
- return pt(u).then((l) => {
890
- if (!k)
899
+ })), W = ot(te), M = O === "auto" ? W ? "dark" : "light" : O;
900
+ N(() => {
901
+ let b = !0;
902
+ return pt(u).then((k) => {
903
+ if (!b)
891
904
  return;
892
- const g = he[u] ?? "plain";
893
- if (l?.languages?.[g])
905
+ const l = he[u] ?? "plain";
906
+ if (k?.languages?.[l])
894
907
  try {
895
- const a = l.highlight(f, l.languages[g], g);
896
- K(a);
908
+ const r = k.highlight(g, k.languages[l], l);
909
+ I(r);
897
910
  return;
898
911
  } catch {
899
912
  }
900
- K(fe(f));
913
+ I(fe(g));
901
914
  }).catch(() => {
902
- k && K(fe(f));
915
+ b && I(fe(g));
903
916
  }), () => {
904
- k = !1;
917
+ b = !1;
905
918
  };
906
- }, [f, u]);
907
- const G = Oe(() => {
908
- if (!I.current || !E.current)
919
+ }, [g, u]);
920
+ const L = Oe(() => {
921
+ if (!j.current || !S.current)
909
922
  return;
910
- I.current.scrollTop = E.current.scrollTop, I.current.scrollLeft = E.current.scrollLeft;
911
- const k = U.current;
912
- if (k) {
913
- const l = E.current.offsetHeight - E.current.clientHeight;
914
- k.style.paddingBottom = `calc(var(--nice-space-2, 8px) + ${l}px)`, k.scrollTop = E.current.scrollTop;
923
+ j.current.scrollTop = S.current.scrollTop, j.current.scrollLeft = S.current.scrollLeft;
924
+ const b = H.current;
925
+ if (b) {
926
+ const k = S.current.offsetHeight - S.current.clientHeight;
927
+ b.style.paddingBottom = `calc(var(--nice-space-2, 8px) + ${k}px)`, b.scrollTop = S.current.scrollTop;
915
928
  }
916
- }, []), _ = Oe(
917
- (k) => {
918
- if (!Q(k) && k.key === "Tab" && !p) {
919
- k.preventDefault();
920
- const l = k.currentTarget, g = l.selectionStart, a = l.selectionEnd, N = " ".repeat(b);
921
- if (k.shiftKey) {
922
- const T = f.substring(0, g).lastIndexOf(`
929
+ }, []), w = Oe(
930
+ (b) => {
931
+ if (!Y(b) && b.key === "Tab" && !p) {
932
+ b.preventDefault();
933
+ const k = b.currentTarget, l = k.selectionStart, r = k.selectionEnd, _ = " ".repeat(f);
934
+ if (b.shiftKey) {
935
+ const T = g.substring(0, l).lastIndexOf(`
923
936
  `) + 1;
924
- if ((f.substring(T, g).match(/^(\s*)/)?.[1] ?? "").length >= b) {
925
- const ne = f.substring(0, T) + f.substring(T + b);
926
- z(ne), setTimeout(() => {
927
- l.selectionStart = l.selectionEnd = g - b;
937
+ if ((g.substring(T, l).match(/^(\s*)/)?.[1] ?? "").length >= f) {
938
+ const ie = g.substring(0, T) + g.substring(T + f);
939
+ $(ie), setTimeout(() => {
940
+ k.selectionStart = k.selectionEnd = l - f;
928
941
  }, 0);
929
942
  }
930
943
  } else {
931
- const F = f.substring(0, g) + N + f.substring(a);
932
- z(F), setTimeout(() => {
933
- l.selectionStart = l.selectionEnd = g + b;
944
+ const Z = g.substring(0, l) + _ + g.substring(r);
945
+ $(Z), setTimeout(() => {
946
+ k.selectionStart = k.selectionEnd = l + f;
934
947
  }, 0);
935
948
  }
936
949
  }
937
950
  },
938
- [f, z, b, Q, p]
939
- ), ee = f.split(`
940
- `).length, Y = he[u] ?? "plain";
941
- return /* @__PURE__ */ W(
951
+ [g, $, f, Y, p]
952
+ ), Q = g.split(`
953
+ `).length, K = he[u] ?? "plain";
954
+ return /* @__PURE__ */ z(
942
955
  "div",
943
956
  {
944
- ref: Z,
945
- className: `nice-simple-code-editor nice-simple-code-editor--${w}${M === "auto" ? " nice-simple-code-editor--auto" : ""} ${L ?? ""}`,
946
- style: { height: C, width: x },
947
- "data-testid": R,
957
+ ref: J,
958
+ className: `nice-simple-code-editor nice-simple-code-editor--${M}${O === "auto" ? " nice-simple-code-editor--auto" : ""} ${R ?? ""}`,
959
+ style: { height: x, width: C },
960
+ "data-testid": A,
948
961
  "data-language": u,
949
- "data-theme": w,
962
+ "data-theme": M,
950
963
  children: [
951
- n && /* @__PURE__ */ o("div", { ref: U, className: "nice-simple-code-editor__line-numbers", children: Array.from({ length: ee }, (k, l) => /* @__PURE__ */ o("div", { className: "nice-simple-code-editor__line-number", children: l + 1 }, l)) }),
952
- /* @__PURE__ */ W("div", { className: "nice-simple-code-editor__editor-area", children: [
953
- /* @__PURE__ */ o(
964
+ i && /* @__PURE__ */ n("div", { ref: H, className: "nice-simple-code-editor__line-numbers", children: Array.from({ length: Q }, (b, k) => /* @__PURE__ */ n("div", { className: "nice-simple-code-editor__line-number", children: k + 1 }, k)) }),
965
+ /* @__PURE__ */ z("div", { className: "nice-simple-code-editor__editor-area", children: [
966
+ /* @__PURE__ */ n(
954
967
  "pre",
955
968
  {
956
- ref: I,
969
+ ref: j,
957
970
  "aria-hidden": "true",
958
- className: `nice-simple-code-editor__highlight language-${Y}`,
959
- children: /* @__PURE__ */ o(
971
+ className: `nice-simple-code-editor__highlight language-${K}`,
972
+ children: /* @__PURE__ */ n(
960
973
  "code",
961
974
  {
962
- className: `language-${Y}`,
975
+ className: `language-${K}`,
963
976
  dangerouslySetInnerHTML: {
964
- __html: j + (f.endsWith(`
977
+ __html: ee + (g.endsWith(`
965
978
  `) ? `
966
979
  ` : "")
967
980
  }
@@ -969,30 +982,30 @@ function vt(r) {
969
982
  )
970
983
  }
971
984
  ),
972
- /* @__PURE__ */ o(
985
+ /* @__PURE__ */ n(
973
986
  "textarea",
974
987
  {
975
- ref: E,
988
+ ref: S,
976
989
  className: "nice-simple-code-editor__textarea",
977
- value: f,
978
- onChange: (k) => z(k.target.value),
979
- onKeyDown: _,
980
- onScroll: G,
990
+ value: g,
991
+ onChange: (b) => $(b.target.value),
992
+ onKeyDown: w,
993
+ onScroll: L,
981
994
  readOnly: p,
982
995
  placeholder: B,
983
996
  spellCheck: !1,
984
997
  autoCapitalize: "off",
985
998
  autoCorrect: "off",
986
- "aria-describedby": p ? void 0 : $
999
+ "aria-describedby": p ? void 0 : E
987
1000
  }
988
1001
  ),
989
- !p && /* @__PURE__ */ o("span", { id: $, className: "nice-sr-only", children: V("input.tabEscapeHint", "Tab indents. To leave the editor, press Escape, then Tab.") })
1002
+ !p && /* @__PURE__ */ n("span", { id: E, className: "nice-sr-only", children: X("input.tabEscapeHint", "Tab indents. To leave the editor, press Escape, then Tab.") })
990
1003
  ] })
991
1004
  ]
992
1005
  }
993
1006
  );
994
1007
  }
995
- const ve = "nice-code-editor-styles", Ce = `
1008
+ const ve = "nice-code-editor-styles", xe = `
996
1009
  .nice-code-editor,
997
1010
  .nice-code-diff-editor {
998
1011
  border: 1px solid var(--nice-border, #e0e0e0);
@@ -1014,6 +1027,14 @@ const ve = "nice-code-editor-styles", Ce = `
1014
1027
  font-size: 14px;
1015
1028
  }
1016
1029
 
1030
+ /* the matching bracket pair: a tinted box with a firm edge instead of Monaco's faint outline */
1031
+ .nice-code-editor .monaco-editor .bracket-match {
1032
+ box-sizing: border-box;
1033
+ background: color-mix(in srgb, var(--nice-color-primary, #6366f1) 24%, transparent);
1034
+ border: 1px solid color-mix(in srgb, var(--nice-color-primary, #6366f1) 75%, transparent);
1035
+ border-radius: 2px;
1036
+ }
1037
+
1017
1038
  .nice-code-editor__error {
1018
1039
  display: flex;
1019
1040
  flex-direction: column;